Snippets tagged “javascript”
227 snippets use this tag.
- Ajax Upload imagePHP
To upload an image using Ajax, you can use the following steps:
- AngularJs '{{' and '}}' symbols conflict with TwigAngularJs
IF you use Symfony as PHP framework and AngularJs as Javascript framework, you will have problems with print function, if you use Twigs
- AngularJs Blocks Form Submit without "action"AngularJs
AngularJs Blocks Form Submit without "action"-In general, AngularJs blocks the form submit, because of empty "Action".
- AngularJs Directive Scope '&' MethodAngularJs
The “&” operator allows you to invoke or evaluate an expression on the parent scope of whatever the directive is inside of. Learn with W3docs tutorial.
- Basic Knowledge About AngularJs Services and FactoriesAngularJs
AngularJs suggests Services and Factories to have global actions and variables for controllers and for many other AngularJs components. Gain a basic knowledge about AngularJs services and factories.
- Calling a PHP function by onclick eventPHP
To call a PHP function using an onclick event, you will need to use a little bit of JavaScript.
- Colors in JavaScript ConsoleJavaScript
The console.log() method outputs a message to the web console. Read the tutorial and learn the simplest method of putting a single or multiple styles to it.
- Confirm button before running deleting routine from websitePHP
Yes, you can add a confirm button before running a delete routine on a website using PHP.
- Form Validation Using JavaScriptJavaScript
Incorrect information leads to bad user interactions. So as to prevent this problem, read and learn how to validate forms with the help of JavaScript!
- How and When to Write Comments in JavascriptJavaScript
There are 2 types of JavaScript comments: single-line and multi-line. See when to use them with examples, and also use comments to prevent execution when testing alternative code.
- How do I implement basic "Long Polling"?PHP
Here's an example of how you can implement Long Polling in PHP:
- How do I return a proper success/error message for JQuery .ajax() using PHP?PHP
To return a proper success/error message for jQuery.ajax() using PHP, you can do the following:
- How Get the Current Year in JavaScriptJavaScript
Read this tutorial and learn about the simplest and fastest method of getting the current year a four-digit number using the Date object in JavaScript.
- How JavaScript Closures WorkJavaScript
In the following snippet, we are going to represent how JavaScript closures work. The easiest way of learning how to use them is investigating examples.
- How the Keyword “this” WorksJavaScript
In this tutorial, you can find information about the usage of the keyword “this” in JavaScript. Here, it works differently compared with other languages.
- How to Access the Correct “this” Inside a CallbackJavaScript
In the following tutorial, you can find the answer to one of the most common issues in JavaScript: how to access the correct “this” inside a callback.
- How to Add a Class to a Given ElementJavaScript
Read the tutorial and learn the two suggested methods of creating a JavaScript function that will add a class to the <div> element and solve your problem.
- How to add a print button to a web pagePHP
To add a print button to a web page using PHP, you can use the following steps:
- How to Add a Text on the HTML5 <canvas> ElementCSS
In this tutorial, you’ll find out how to add text on the HTML5 <canvas> element. For that, you need Javascript. Use the fillText() and strokeText() methods.
- How to Add and Remove Multiple or Single Select Options using jQueryJavaScript
Read this tutorial and learn how you can remove multiple options or a specific option in the select list using some interesting and useful jQuery methods.
- How to Add Days to JavaScript DateJavaScript
Read the tutorial and learn a simple method of adding days to JavaScript date with two inbuilt functions used for setting and getting the day of the month.
- How To Add New Elements To A JavaScript ArrayJavaScript
To add new elements you can use the following JavaScript functions: push() unshift(), concat() function or splice(). See examples.
- How to Add Options to a Select Element using jQueryJavaScript
Read this tutorial and find useful information about the multiple methods of adding options to a select element using jQuery. Choose the best one for you.
- How to Add the Marquee Effect without Using the Marquee Tag (with CSS, JavaScript and jQuery)CSS
Learn the alternative ways of having continually scrolling text without using the obsolete <marquee> tag. See examples with CSS animations, JavaScript and jQuery.
- How to Append an Item to an Array in JavaScriptJavaScript
On this page, you can learn the ways of appending an item or multiple items to an array in JavaScript.
- How to Apply CSS Styles to Only the Half of a Word or Character?CSS
Learn how to make a word or character have half style or triple style. Use only CSS to get the effect, or do it with the help of JavaScript and jQuery.
- How to Build a Hex Color Generator in JavaScriptJavaScript
If you want to create your own color generator using JavaScript, then you’re welcome to our tutorial. In this snippet, we are going to build a hex color generator step by step.
- How to Calculate Text Width with JavaScriptJavaScript
Read this JavaScript tutorial and learn about the best method of calculating the text width. Read about the advantages of the method over other methods.
- How to call a php script/function on a html button click?PHP
To call a PHP script or function on a HTML button click, you can use JavaScript to send an HTTP request to the server when the button is clicked.
- How to Capitalize the First Letter in a String in JavaScriptJavaScript
Read this JavaScript tutorial and learn the methods and undertake some steps which will help you make the first letter in the string uppercase easily.
- How to Catch Directive DeletionAngularJs
AngularJs lets us to use directives and make our code more professional.But sometimes we need to know when our directive has been removed.This snippet will show you how to know it.
- How to Center a <div> on the Screen Using jQueryJavaScript
Read the tutorial and learn the jQuery method of centering the <div> element on the screen. Get a code snippet to add your script for centering the element.
- How to Change an Element’s Class with JavaScriptJavaScript
One of the most common issues in JavaScript is changing an element’s class. In this snippet, we are going to show you the efficient ways of achieving it.
- How to Change Selected Value of a Drop-Down List Using jQueryJavaScript
In this tutorial, you will read and learn about jQuery methods that are used to change the selected value of a drop-down list via its text description.
- How to Change the Href for a Hyperlink using jQueryJavaScript
Read this JavaScript tutorial and learn the easy way of changing the href attribute for a hyperlink step by step by using one of the methods of jQuery.
- How to Change the Image Source Using jQueryJavaScript
Read this tutorial which will provide you with useful information about the best and easy method that can be used to change the image source using jQuery.
- How to Change Variables from Outside of a DirectiveAngularJs
The way of changing variables depends on the type of scope. See how to change for each type of scope: not inherit, inherit and isolated.
- How to Check a Radio Button with jQueryJavaScript
Read the tutorial and learn the right way of checking a radio button with jQuery. Also, read how to handle with different versions of jQuery while checking.
- How to Check a Webpage is Loaded Inside an iframe or into the Browser WindowJavaScript
Read this JavaScript tutorial and find a working code for checking whether the webpage is loaded inside an iFrame or directly into the browser window.
- How to Check and Uncheck Checkbox with JavaScript and jQueryJavaScript
In this tutorial, you will read and learn about several JavaScript and jQuery methods for checking and unchecking a checkbox. Choose the best one for you.
- How to Check for a Hash Value in a URL Using JavaScriptJavaScript
Read this tutorial and learn the fastest and simplest way of checking for a hash value in the URL using the window.location.hash method in JavaScript.
- How to Check for Empty/Undefined/Null String in JavaScriptJavaScript
In this tutorial, we are going to show you the ways of checking whether the JavaScript string is empty, undefined, or null. Just follow the guidelines.
- How to Check for the Existence of Nested JavaScript Object KeyJavaScript
In this tutorial, you will find several methods that are used to test the existence of the nested JavaScript object keys. Also, find how to avoid TypeError.
- How to Check if a Key Exists in JavaScript ObjectJavaScript
This snippet is explaining how to check whether a key exists in a JavaScript object. Examine the solutions given above and choose the most appropriate.
- How to Check If a String Contains Another Substring in JavaScriptJavaScript
Read this tutorial and learn several methods used to check if a string contains another substring in JavaScript or not. Read information and see examples.
- How to Check if a Value is an Object in JavaScriptJavaScript
Checking the data type of the value can be misleading. Read this tutorial and learn which operator is used to check if a value is an object in JavaScript.
- How to Check if a Variable is of Function TypeJavaScript
Read this JavaScript tutorial and learn several fast and useful methods that are invoked for checking whether the variable is of function type or not.
- How to Check If an Element Contains a Class in JavaScriptJavaScript
Read this tutorial and learn valuable information about the multiple methods that are used for checking if the element contains a class in JavaScript.
- How to Check if an Element is Present in an Array in JavaScript?JavaScript
Very often we need to check whether the element is in an array in JavaScript or not. In this snippet, we are going to learn some methods to do that.
- How to Check if an Enter Key is Pressed with jQueryJavaScript
Read this tutorial and learn the right method of detecting whether the user pressed the Enter key. The given method provides a cross browser compatibility.
- How to Check if an Object has a Specific Property in JavaScriptJavaScript
Read this tutorial and learn the methods of checking whether the specified object has the specified property in JavaScript. Find the fastest one for you.
- How to Check if Element is Visible after ScrollingJavaScript
Read the tutorial and find out one of the methods of checking whether the element is visible after scrolling with jQuery. Also, find about utility function.
- How to Check if Function Exists in JavaScriptJavaScript
In this tutorial, you will read and learn information about the two methods of checking whether a function exists in JavaScript or it has not been defined.
- How to Check if JavaScript Object is EmptyJavaScript
Read this tutorial and find methods of checking whether a JavaScript object is empty or not. Choose the best one for you and get the code immediately.
- How to Check if the Variable is UndefinedJavaScript
This tutorial provides the method of checking whether the type of the variable is undefined. Read about the differences between undefined and “undefined”.
- How to Check if User Has Scrolled to the Bottom of the PageJavaScript
Read this tutorial and learn information about jQuery method that is run for checking whether the user has scrolled to the bottom of the page or near to it.
- How to Check Whether a String Matches a RegEx in JavaScriptJavaScript
Read and learn two methods used to check whether a string matches RegEx in JavaScript. Also, see which method is the fastest and differences between them.
- How to Check Whether an Object is a DateJavaScript
Read this JavaScript tutorial and learn several ways that are used for checking whether the parameter passed to the method is of type Date object or not.
- How to Clear Local Storage JavaScriptJavaScript
Read this JavaScript tutorial and learn useful information about localStorage and methods that clear the local storage of records for a specific domain.
- How to Clear the Canvas for RedrawingJavaScript
The <canvas> element helps drawing graphics on the fly via JavaScript. Read the tutorial and find the dos and don’ts of clearing the canvas for redrawing.
- How to Clone a Date Object in JavaScriptJavaScript
Read the tutorial and learn two useful methods that are used to clone the Date object in JavaScript. Get the current date and the cloned one right away.
- How to Clone a JavaScript ObjectJavaScript
Cloning an object in JavaScript is one of the most common and complicated practices at the same. In this chapter, we will explain how to do it correctly.
- How to Compare Two JavaScrpt ArraysJavaScript
You can either loop through the arrays or convert them to string and then compare. This tutorial provides several fast methods of comparing two arrays.
- How to Convert a Comma-Separated String into ArrayJavaScript
Read this tutorial and learn information about the JavaScript built-in split() method which is called for converting a comma-separated string in an array.
- How to Convert a Float Number to Whole Number in JavaScriptJavaScript
In this tutorial, you will read and learn detailed information about the methods used for converting a float number to a whole number with lots of examples.
- How to Convert a JavaScript Date to UTCJavaScript
In this tutorial, you will read and learn useful information about the right way of converting a JavaScript Date to the Coordinated Universal Time standard.
- How to Convert a Number to a String in JavaScriptJavaScript
Read the tutorial and find several easy and fast approaches to converting a number to a string in JavaScript. Choose the best method for your workflow.
- How to Convert a PHP Array to a JavaScript ArrayPHP
In this tutorial, you can find a comprehensive guideline on how to convert a PHP array to JavaScript accurately. Just check out the options and examples.
- How to Convert a String into a Date in JavaScriptJavaScript
Read this tutorial and learn the way of converting a string into a Date. Also, read about UTC method, ISO format and much more to get a relevant answer.
- How to Convert a Unix Timestamp to Time in JavaScriptJavaScript
Read the tutorial and find how you can convert the UNIX timestamp to time in JavaScript to make the Unix format date-time value in a user-readable format.
- How to Convert Arguments Object to an ArrayJavaScript
Read this JavaScript tutorial and learn information about the useful methods that are used for converting array-like arguments object to an Array easily.
- How to Convert Decimal to Hexadecimal in JavaScriptJavaScript
Read this tutorial and find the easiest way of converting the decimal number to hexadecimal in JavaScript. Also, find information about the number systems.
- How to Convert JavaScript String to be All Lowercase and Vice VersaJavaScript
Read this tutorial and learn the way of making a JavaScript string all lowercase and uppercase with the help of toLowerCase() and toUpperCase() functions.
- How to Convert Object to StringJavaScript
Read this JavaScript tutorial and learn about the fastest methods of converting object into string. Read about JSON.stringify() and toString() methods.
- How to Convert RGB to Hex and Vice VersaJavaScript
Read this tutorial and learn several methods that are used for converting the RGB value to Hexadecimal value easily with the help of JavaScript function.
- How to Convert Set to Array in JavaScriptJavaScript
Read the tutorial and learn about several methods used for converting Set to Array in JavaScript. Also, read about differences between these two structures.
- How to Convert String to Number in JavaScriptJavaScript
There are several methods of converting a string into a number: parseInt() #; parseFloat() #, Number() #, etc. See examples.
- How to Convert String to Title Case with JavaScriptJavaScript
Read this JavaScript tutorial and learn information about the combinations of methods that make it possible to convert the string to title case easily.
- How to Convert the Image into a Base64 String Using JavaScriptJavaScript
Read this tutorial and learn several methods of converting an image to a Base64 string using JavaScript. Choose the right approach for you and try examples.
- How to Copy Array Items into Another ArrayJavaScript
Read this JavaScript tutorial and learn several useful methods of copying array items into another array. Get to know which method to choose for your case.
- How to Copy the Text to the Clipboard with JavaScriptJavaScript
Copying the text to clipboard makes it easier using the web page, so users will definitely like this functionality. You can create it by the help of JavaScript and we’re here to help you.
- How to Count String Occurrence in StringJavaScript
Read this tutorial and learn several useful methods that are used to count the string occurrence in a string. Choose one of the working methods for you.
- How to Count the Number if Keys/Properties of a JavaScript objectJavaScript
It is frequently necessary to count the number of keys/properties of an object in JavaScript. Find several solutions to that issue in this short tutorial.
- How to Create a Dialog with JavaScriptJavaScript
Read this JavaScript tutorial and learn information about the method which can create a modal dialog with an optional message and “OK” and “Cancel” buttons.
- How to Create a Modal Dialog Box with CSS and JavaScriptJavaScript
Learn how to create Modal Dialog with adding a bit of Javascript to your code. Create your code step by step and find examples!
- How to Create a New DOM Element from HTML StringJavaScript
Read this JavaScript tutorial and find the method that is used for creating a new DOM element from an HTML string. Get the explanation and see examples.
- How to Create a Popup Form Using JavaScriptJavaScript
Read this JavaScript tutorial and learn how to create popup login, contact, multiple popup logins in one page and other forms on your website with examples.
- How to Create a Scroll Indicator with JavaScriptJavaScript
Know how to create a scrollbar indicator element on your webpage which indicates how far the user has scrolled down the page. Use a little JavaScript code to animate your webpage bar.
- How to Create a Two Dimensional Array in JavaScriptJavaScript
The two-dimensional array is an array of arrays. Read this JavaScript tutorial and find out several methods of creating two dimensional arrays easily.
- How to Create Ajax Submit Form Using jQueryJavaScript
This tutorial provides several methods of creating an Ajax submit form using jQuery easily. Read about the differences of the GET and POST HTTP methods.
- How to Create an Array Containing 1…NJavaScript
Read this JavaScript tutorial and get information concerning the problem of creating an Array that contains 1 through to N. Find two methods for solving it.
- How to Create and Trigger Event in JavaScriptJavaScript
Read this tutorial and learn how you can create and dispatch the DOM Events in JavaScript. Also, learn to add custom data and trigger built-in events.
- How to Create Fullscreen Overlay Navigation MenuJavaScript
Read this tutorial and learn which two functions are used to create a fullscreen overlay navigation menu to make your website more beautiful and catchy.
- How to Create Range Slider With HTML5 and jQueryJavaScript
HTML5 range input type allows creating range sliders. Read the tutorial and learn a simple solution including a jQuery code to achieve the desired result!
- How to Create Smooth Scrolling When Clicking an Anchor LinkJavaScript
Read the tutorial and learn information about the two jQuery and JavaScript solutions that are used to create smooth scrolling when clicking an anchor link.
- How to Declare and Initialize an Array in JavaScriptJavaScript
Read this tutorial and learn the two basic methods of declaring and initializing an Array in JavaScript. Also, read about the differences of the methods.
- How to Declare Constants in JavaScript?JavaScript
Read this tutorial and learn useful information about declaring a constant by using the const keyword which creates a read-only reference to the value.
- How to Define Global Variable in a JavaScript FunctionJavaScript
Read the tutorial and learn how to define a global variable in a JavaScript function. Also, read about the differences about the global and local variables.
- How to Delete the First Character of a String in JavaScriptJavaScript
Read this tutorial and learn some useful information about the methods that are used for deleting the first character of a string in JavaScript easily.
- How to Detect a Click Outside an ElementJavaScript
A common pattern used in JavaScript is detecting a click outside an element. This snippet offers you the most efficient ones among the various solutions.
- How to Detect Escape Key Press Using jQueryJavaScript
Read this tutorial and learn the two methods of detecting an escape key press using jQuery. Read about keyup and keydown event handler and see examples.
- How to Detect Idle Time in JavaScriptJavaScript
Read this tutorial and learn useful information about the vanilla JavaScript and jQuery solutions that are used for detecting the idle time correctly.
- How to Disable Text Selection, Copy, Cut, Paste and Right-click on a Web PageJavaScript
Learn the ways of how to disable text selection highlighting, how to disable copy, cut and paste, how to disable right-click. See example with CSS, JavaScript and jQuery.
- How to Disable the Browser Autocomplete and Autofill on HTML Form and Input FieldsHTML
Learn how to prevent browsers auto filling the input fields of HTML forms. Use autocomplete="off" to specify that autocomplete is disabled. See examples.
- How to Display a JavaScript ObjectJavaScript
Sometimes it is necessary to display a JavaScript object. With the help of the given tutorial, you will find the best solutions to displaying an object.
- How to Display a Message if JavaScript is Turned OffJavaScript
If you have a content that will not function without JavaScript, you need to display a message with an explanation of the problem. In this snippet, we are going to have a look at 2 simple methods to display the content when JavaScript is turned off.
- How to Distinguish Between Left and Right Mouse Click with jQueryJavaScript
In this tutorial, you will read and learn useful information about the fastest method of distinguishing between left and right mouse click with jQuery.
- How to Do String Interpolation in JavaScriptJavaScript
Read this tutorial and learn the simplest method of doing a string interpolation in JavaScript. Also, read information about string literal and placeholder.
- How to Dynamically Change Template URL in Angular JS DirectivesAngularJs
TemplateUrl can be not only a value. It can be a function with any arguments, which returns a value as URL. See how it looks.
- How to Empty an Array in JavaScriptJavaScript
This tutorial provides useful information about clearing an existing array in JavaScript. Get familiar to multiple methods and find the best one for you.
- How to Encode and Decode Strings with Base64 in JavaScriptJavaScript
Read this tutorial and learn useful information about two JavaScript built-in functions which are used to convert a string to and from base64 encoding.
- How to Encode JavaScript Object to Query-StringJavaScript
Read this JavaScript tutorial and learn useful information about the two widely used methods that are used for encoding objects to query strings easily.
- How to Encode JavaScript URLJavaScript
In the tutorial, you can read and learn useful information about the two JavaScript functions that are used for encoding URL and their use cases in detail.
- How to Execute a JavaScript Function when You have Its Name as a StringJavaScript
Read this tutorial and learn about the safe method of calling a function when you have its name as a string. Also, read about why you should not use eval().
- How to Extend an Existing JavaScript Array with Another Array Without Creating a New ArrayJavaScript
Read this JavaScript tutorial and learn about several useful methods for extending an existing an Array with another array without creating a new array.
- How to Find out the Caller Function in JavaScriptJavaScript
Read this JavaScript tutorial and learn the accepted method of finding out the call stack. Get information about the obsolete method of getting the call.
- How to Find the Min/Max Elements in an Array in JavaScriptJavaScript
Read this JavaScript tutorial and learn about the methods used to find the minimum and maximum number of elements in an array. Find the fastest solution.
- How to Find the Sum of an Array of NumbersJavaScript
Read this JavaScript tutorial and learn several methods used to find or calculate the sum of an array of numbers. Also, find which is the fastest one.
- How to Format a JavaScript DateJavaScript
Read the tutorial and find out the methods and libraries used to format the JavaScript date. Find the method you think is best for you and get the codes.
- How to Format a Number with Two Decimals in JavaScriptJavaScript
Read this JavaScript tutorial and learn useful information about several easy built-in methods that are used for formatting the number with two decimals.
- How to Format Number with Two DecimalsJavaScript
In this JavaScript tutorial, you will find information about the formatting number to display with two decimals. Also, read about solving rounding issues.
- How to Format Numbers as Currency StringJavaScript
This tutorial provides useful information about the formatting number as currency strings. Read and learn several methods you can use to solve your problem.
- How to Generate a Random Number Between Two Numbers in JavaScriptJavaScript
It is frequently necessary to generate a random number between two numbers while working with JavaScript. This snippet will help you to do it efficiently.
- How to Get a Class Name of an ObjectJavaScript
Read this tutorial and learn information about several methods that are used for getting the class name of the object in JavaScript. Also, try examples.
- How to Get a Timestamp in JavaScriptJavaScript
Almost all the developers come across the question: how to get a timestamp in JavaScript. This tutorial will help you find the most efficient methods to use.
- How to Get All Property Values of a JavaScript ObjectJavaScript
Read this tutorial and learn about several methods used for detecting the property values of an object without knowing the key based on specifications.
- How to Get Current URL in JavaScriptJavaScript
Read and learn how to get the current URL in JavaScript by using Location object properties. Also, gain an understanding about URL and its components.
- How to Get File Extensions with JavaScriptJavaScript
Read this tutorial and learn several useful, fast and simple one-line and extended solutions of extracting file extensions with the help of JavaScript.
- How to Get Image Size Using JavaScriptJavaScript
Read this tutorial and learn the two methods of getting the width and height of the image. Learn about the properties that help to get the image size.
- How to Get JavaScript Stack Trace When Throwing an ExceptionJavaScript
Read this JavaScript tutorial and learn useful information about the two methods that are used in programming to get stack trace when throwing an exception.
- How to Get Query String Values in JavaScriptJavaScript
On this page, you can find fast and simple solutions on how to get query string values in JavaScript. Just follow the examples given below to make it work.
- How to Get the Browser Viewport DimensionsJavaScript
Read this JavaScript tutorial and learn information about two sets of properties that are used to obtain the height and width of the viewport dimension.
- How to Get the Children of the $(this) SelectorJavaScript
Getting the children of the $(this) selector is one of the common issues in modern JavaScript. Find the most proper answer to the problem in this snippet.
- How to Get the Client Timezone Offset in JavaScriptJavaScript
Read this tutorial and learn several useful methods that are used to detect the client timezone offset in JavaScript easily. Choose the best one for you.
- How to Get the Current Date and Time in JavaScriptJavaScript
The tutorial provides information of getting the current date, time and both by running a simple piece of code. Also, get the full explanation of the code.
- How to Get the data-id AttributeJavaScript
Read this tutorial and learn the right ways of getting the data-id attribute using jQuery two methods. Also, learn more information about the two methods.
- How to Get the Difference Between Two Arrays in JavaScriptJavaScript
Read this tutorial and learn several JavaScript and jQuery methods that help you get the difference between two arrays easily. Choose the best one for you.
- How to Get the First Character of a StringJavaScript
Read this JavaScript tutorial and learn several string methods that are used to retrieve the first character of a string. Choose the best one for you.
- How to Get the First Key Name of a JavaScript ObjectJavaScript
Read this JavaScript tutorial and learn about two methods of getting the first key name of an object. Get one-liner codes and make your work done properly.
- How to Get the Height of an ElementCSS
In this tutorial, you can find out how to get the height of an element using jQuery. Use offsetHeight and clientHeight properties and different jQuery methods.
- How to Get the ID of the Element that Fired an Event in jQueryJavaScript
This tutorial provides you the method of getting the id of the element fired an event in jQuery. Read about the event.target property and this keyword.
- How to Get the Index of an Array that Contains Objects in JavaScriptJavaScript
Read this JavaScript tutorial and learn several useful, fast and simple methods that are used for getting the index of an array that contains objects.
- How to Get the Last Characters of a StringJavaScript
Read and learn several easy and simple methods you can use for retrieving the last characters of a JavaScript string. Choose the best method for your case.
- How to Get the Last Item in an ArrayJavaScript
Read the tutorial and learn the methods of getting the last item in the array. Get to know the methods and their peculiarities to find the best solution.
- How to Get the Value of a Textarea using jQueryJavaScript
Read this tutorial and learn useful information about how you can detect the value of the HTML <textarea> element easily using one of the jQuery methods.
- How to Get the Value of Selected Option in a Select BoxJavaScript
Read the tutorial and learn the methods of getting the value of the selected option in a select box using jQuery. Read about the text() and val() methods.
- How to Get the Value of Text Input Field Using JavaScriptJavaScript
Read this tutorial and learn about several methods of getting the value of the input textbox value without wrapping the input element inside a form element.
- How to Get URL ParametersJavaScript
Read this JavaScript tutorial and learn how you can easily get the URL parameters with the help of the methods provided by the URLSearchParams interface.
- How to Hide and Show a <div>JavaScript
Read this tutorial and learn several CSS, JavaScript and jQuery methods of hiding and showing the <div> element. Also, you can find examples and try them.
- How to HTML-encode a StringJavaScript
Read this JavaScript tutorial and learn about some useful and fast methods that help you to HTML-encode the string without causing the XSS vulnerability.
- How to Include a JavaScript File in Another JavaScript FileJavaScript
Read the tutorial and find out different approaches to including a JavaScript file in another JavaScript file. Also, find a brief representation of methods.
- How to Insert an Element After Another Element in JavaScriptJavaScript
Read this JavaScript tutorial and learn useful information about modern approaches of inserting an element after another element using two easy methods.
- How to Insert an Item into an Array at a Specific IndexJavaScript
Read this JavaScript tutorial and learn the right method of inserting an item into an array at a specific index. Try examples and copy the code right away.
- How to Know which Radio Button is Selected using jQueryJavaScript
Read this JavaScript tutorial and learn the method of getting the value of the selected radio button with the help of jQuery. Copy the code right away.
- How to List the Properties of a JavaScript ObjectJavaScript
Read this tutorial and learn useful information about the two popular built-in methods that are used for listing the properties of the object in JavaScript.
- How to Loop through an Array in JavaScriptJavaScript
The most common ways to loop through an array in JavaScript are the for, for/in and while loops. See how to use them. Examples.
- How to Loop Through Array and Remove Items Without Breaking the For LoopJavaScript
Read this JavaScript tutorial and learn some useful information about the method of looping through an Array and removing items without breaking for loop.
- How to Loop Through or Enumerate a JavaScript ObjectJavaScript
Read this tutorial and learn several useful methods of looping through or enumerate a JavaScript object. Try and copy the piece of the code right away.
- How to Make a Div Stick to the Top of Screen when Scrolling with CSS and JavascriptCSS
This snippet will help you to make a <div> stick to the top of the screen when you scroll the page. Find out how to this using HTML, CSS, and Javascript.
- How to Make Button onclick in HTMLHTML
If you want to make a button onclick, you need to add the onclick event attribute to the <button> element. Learn How to Make Button Onclick with Examples.
- How to Make HTTP GET Request in JavaScriptJavaScript
Read the tutorial and learn the how to make an HTTP GET request in JavaScript and make an asynchronous request and handle the response inside event handler.
- How to Manage a Redirect Request after a jQuery Ajax CallJavaScript
In this JavaScript tutorial, you will read and learn detailed information about the method used for managing a redirect request after a jQuery Ajax call.
- How to Measure Time Taken by a Function to ExecuteJavaScript
Read this JavaScript tutorial and learn several fast and useful methods that are used to calculate the time taken by a function to execute in milliseconds.
- How to Merge Properties of Two JavaScript Objects DynamicallyJavaScript
Have you ever wanted to merge the properties of two objects in JavaScript dynamically? This tutorial is aimed at showing you how to do it in rational ways.
- How to Merge Two Arrays in JavaScript and De-duplicate ItemsJavaScript
Read this tutorial and find useful information about the simplest methods that are used for merging two arrays and removing duplicate items in JavaScript.
- How to Move an Array Element from One Array Position to AnotherJavaScript
In this JavaScript tutorial, you will read and learn information about an easy insert strategy method of moving the array element to another position.
- How to output the response HTML data by a jQuery AJAX request?PHP
In a jQuery AJAX request, you can output the response HTML data using the .html() method.
- How to Pass a Parameter to a setTimeout() CallbackJavaScript
Read this JavaScript tutorial and learn the right way of passing a parameter to a setTimeout() callback. Also, get information about function binding.
- How to Pass Parameters in Computed Properties in Vue.jsVue.js
Read the tutorial and learn about how you can pass parameters in computed properties. Read about the differences between computed properties and methods.
- How to pass php variable's value to jqueryPHP
You can pass a PHP variable's value to jQuery by using the PHP variable in a JavaScript script, and then accessing it with jQuery.
- How to Print a Circular Structure in a JSON-like FormatJavaScript
In this JavaScript tutorial, you will find useful information about the method that is used to format an object to JSON what contains circular structure.
- How to Print a Message to the Error Console Using JavaScriptJavaScript
Read this tutorial and learn about the role of console object in JavaScript and, also, learn the way of printing the message to the error console easily.
- How to Print JavaScript Console Using PHPPHP
On this page, we will illustrate how to use PHP echo for printing JavaScript console. Here, you will find several options for different occasions.
- How to Properly Watch for Nested Data in Vue.jsVue.js
In this Vue.js tutorial, you will read and learn about methods of properly watching for nested data. Also, read about deep watcher and computed property.
- How to Randomize (shuffle) a JavaScript ArrayJavaScript
In JavaScript, there no any built-in method of shuffling a JavaScript array. Read this tutorial and learn what is the popular method of randomizing arrays.
- How to Redirect a Web Page with PHPPHP
In PHP, you can use several functions to make a redirect from one web page to another. Learn how to do it accurately with W3docs.
- How to Redirect Mobile Devices With JavaScript and CSSJavaScript
Learn How to Redirect Mobile Devices With JavaScript and CSS. 1.JavaScript Method, 2. CSS @media Method. Fast solution for web developers.
- How to Remove All CSS Classes Using jQuery/JavaScriptJavaScript
In this tutorial, you can read and learn several easy and simple jQuery methods and pure JavaScript properties that are used to remove all CSS classes.
- How to Remove All the Child Elements of a DOM Node in JavaScriptJavaScript
Read this JavaScript tutorial and learn several simple and fast methods that are used for removing all the child elements of the DOM node with examples.
- How to Remove an Element from an Array in JavaScriptJavaScript
Read this tutorial and learn what several useful Array methods exist that will help you remove the specified element from an Array in JavaScript easily.
- How to Remove Empty Elements from an Array in JavascriptJavaScript
Read this tutorial and learn the method of removing empty elements from an Array. Also, read about removing falsy elements that include an empty string.
- How to Remove Focus Around Buttons on ClickHTML
In this snippet, you can see how to remove the focus around a button on click. To solve this problem, you use the CSS outline property with the “none” value.
- How to Remove Objects from a JavaScript Associative ArrayJavaScript
JavaScript objects can be taught of associative arrays mapping keys to values. Read and find the method used to remove objects from an associative array.
- How to Remove Spaces From StringJavaScript
Read this JavaScript tutorial and learn several methods that are used to remove spaces from a string. Also, know which is the fastest method to choose.
- How to Remove Style Added with the .css() function Using jQueryJavaScript
Read this tutorial and learn several ways of removing style added with the .css() function with the help of jQuery. Choose the best method for your case.
- How to Remove Text from StringJavaScript
Read this JavaScript tutorial and learn useful information about several easy and fast built-in methods that are used for removing the text from a string.
- How to Replace a Character at a Particular Index in JavaScriptJavaScript
In this tutorial, you will read and learn detailed information about methods that are used to replace a character at a particular index in JavaScript.
- How to Replace All Occurrences of a String in JavaScriptJavaScript
On this page, you can find the fast-solutions on how to replace all the occurrences of a string in JavaScript. Read it and find the simplest solution.
- How to Reset File Input with jQueryJavaScript
In this tutorial, you will read and learn useful information about the fastest method of resetting a file input by using some HTML and jQuery methods.
- How to Retrieve an HTML Element's Actual Width and HeightJavaScript
Read this tutorial and learn about the two methods that are used to retrieve an HTML element’s actual width and height. Find the best method for your case.
- How to Select All Text in HTML Text Input When Clicked Using JavaScriptJavaScript
Read the tutorial and learn the two methods of selecting the entire text in HTML text input when clicked using JavaScript code snippets. Also, see examples.
- How to Show Angularjs Filtered CountAngularJs
There are two ways to count items in a filtered AngularJs list used in ngRepeat: to get filter count either in template or in controller. See how to do it.
- How to Sort an Array of IntegersJavaScript
Read this JavaScript tutorial and learn useful information about the logic of the sort() method which will help you sort an array of integers correctly.
- How to Sort Array Alphabetically in JavaScriptJavaScript
Read this JavaScript tutorial and learn the two methods of sorting the elements of an array in alphabetical order based on the values of the elements.
- How to Sort JavaScript Object by KeyJavaScript
In this JavaScript tutorial, you will read and learn information about a functional method of sorting an object by key supported by all major browsers.
- How to Split a String Breaking at a Particular Character in JavaScriptJavaScript
Read this tutorial and find two easy and fast methods of splitting the string breaking at a particular character in JavaScript. Also, find and try examples.
- How to Split Array into ChunksJavaScript
Read the tutorial and find several easy and fast approaches to splitting a JavaScript array into smaller chunks. Choose one of the methods and try examples.
- How to Strip HTML from a String in JavaScriptJavaScript
In this tutorial, you will find several approaches to strippingan HTML from a sting in JavaScript easily. Get the codes and explanations right away.
- How to Subtract Days from Date in JavaScriptJavaScript
Read this tutorial and learn useful information about the instance methods of the Date object to help you subtract days from date in JavaScript easily.
- How to Uncheck a Radio ButtonJavaScript
Read this tutorial and learn useful information about the two jQuery and JavaScript solutions to unchecking a radio button, and choose the method you want.
- How to Unset a JavaScript VariableJavaScript
Read this JavaScript tutorial to know why you cannot delete the property that is created with var. Also, know in which cases you shouldn’t use the operator.
- How to use angularjs filtersAngularJs
Learn How to use Angularjs filters. AngularJs lets us create custom filters and use it like you use other filters. Try examples yourself and see the result.
- How to Use jQuery Selectors on Custom Data AttributesJavaScript
In this tutorial, you will find useful information about the usage of jQuery selectors on custom data attributes. See examples and solve your problem.
- How To Use setInterval in PHP?PHP
setInterval is a JavaScript function and cannot be used directly in PHP.
- How to Validate an E-mail Using JavaScriptJavaScript
Read this tutorial and learn a fast and easy solution to the issue of validating an email using JavaScript. Also, you will read about what the email is.
- How to validate Google reCAPTCHA v3 on server side?PHP
To validate a Google reCAPTCHA v3 on the server side using PHP, you will need to do the following steps:
- How to Write a Function that Accepts Any Number of Arguments in JavaScriptJavaScript
Read this JavaScript tutorial and find two easy methods of writing a function that will accept an indefinite number of arguments. See and try examples.
- How to write a link like <a> which link to the same page in PHP?PHP
In PHP, you can use the echo function to output an HTML <a> tag with a "#id" value for the href attribute, which will link to the same page.
- Is JavaScript a Pass-by-reference or Pass-by-value language?JavaScript
On this page, we will look into pass-by-reference and pass-by-value. Let’s explore their differences and find out what language JavaScript is considered.
- JavaScript: bind() vs apply() and call()JavaScript
Read this JavaScript tutorial and learn about the main differences between the function prototype methods: bind(), call() and apply() and their usages.
- Lazy load images with JavaScriptJavaScript
Read this tutorial and learn detailed information about some simple and fast techniques that are used to decrease image loading time using JavaScript.
- PHP & localStoragePHP
PHP is a programming language that is often used to build web applications.
- Sending multiple data parameters with jQuery AJAXPHP
To send multiple data parameters with jQuery's $.ajax() function in PHP, you can use the data option and set it to an object with the data you want to send.
- Simple jQuery, PHP and JSONP example?PHP
jQuery:
- submit a form in a new tabPHP
To open a form submission in a new tab, you can use the target attribute of the form element and set it to _blank.
- The “right” JSON Date FormatJavaScript
Read the tutorial and learn the right methods of JSON date formatting with the help of JavaScript. Get to know information about ISO 8601 string format.
- The Difference Between Angular-route and Angular-ui-routerJavaScript
Read this Angular.js snippet and get relevant information about the differences and as well as similarities between Angular-route and Angular-ui-router.
- The Difference Between Null and Undefined in JavaScriptJavaScript
Read this JavaScript tutorial and get relevant information about the differences between null and undefined data types. Find out their similarities as well.
- Waiting Until All jQuery Ajax Requests are DoneJavaScript
Read this tutorial and learn useful information about the jQuery function that waits and then executes the function when all the ajax requests resolve.
- What is JavaScript Version of Sleep()JavaScript
The tutorial provides information about JavaScript version of the sleep() which makes the function pause execution for specified seconds of milliseconds.
- What is the “new” Keyword in JavaScriptJavaScript
Here, you will find a quick overview of the “new” keyword in JavaScript. You need to understand it properly for the more effective usage of JavaScript.
- What is the Difference Between JSON.stringify and JSON.parseJavaScript
Read this JavaScript tutorial and learn about two useful JSON methods that are used for converting JavaScript object into string and vice versa easily.
- What is the Difference Between Substr and SubstringJavaScript
Read this JavaScript tutorial and learn about the two String manipulation functions, namely, substr() and substring() methods and difference between them.
- What is the Difference Between the "id" and "name" AttributesHTML
In this snippet, we’re going to discuss the differences between the “id” and “name” attributes, after which you’ll make a better decision of their usage.
- When to Use Double or Single Quotes in JavaScriptJavaScript
Almost all JavaScript developers come across the issue: when to use double or single quotes. Here, we explore possible cases, offering rational solutions.
- Where is array's length property defined?Java
In JavaScript, the length property of an array is defined on the Array.prototype.
- Which are the Valid Values for the "id" AttributeHTML
The “id” attribute defines a unique identifier for HTML elements. In this snippet, you can find out, which are its valid values for HTML, CSS, and Javascript.