- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2416 Articles for HTML
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
The data() in jQuery is used to fetch the value of any custom data attribute from the matched HTML element(s). The jQuery attr() method is used to fetch the value of any standard attribute from the matched HTML element(s). Let us see the differences − The .attr() method includes DOM Manipulation and gets the data from the current HTML or change the HTML code if used to change an attribute value. The .data() method does not include DOM manipulation and gets the data from the internal cache and will change that data if a set is called. The .data() ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
The regex will identify the HTML tags and then the replace() is used to replace the tags with null string. Let’s say we have the following HTML − The tags stripped...)/ig, ''); } The call for the above function to remove tags goes like this − document.write(removeTags('The tags stripped...
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
709 Views
We can strip out HTML tags from a string with JavaScript using the following examples − Strip out HTML tags using Regex Strip out HTML tags using InnerText Strip out HTML tags using Regex The regex will identify the HTML tags and then the replace() is used to replace the tags with null string. Let’s say we have the following HTML − The tags stripped...)/ig, ''); } The call for the above function to remove tags goes like this − document.write(removeTags('The tags stripped...
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
4K+ Views
To detect timezone, we can either set a timezone and display or we can directly display. Here, we will see two examples − Get and Display the default timezone. Set a Timezone and Display it. Get the Default TimeZone To get the default timezone in PHP, we will use the following method − date_default_timezone_get(); Example Let us see the example − Output Default TimeZone:UTC Set a TimeZone and Display In this example, we will first set a timezone using the following method − date_default_timezone_set To get the timezone we have ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
39K+ Views
To detect the user timezone with the name of the timzone itself, use the Internationalization API. This gives the name of the Timezone in which the user and the browser is being worked on. Detect Exact Timezone with Name Example To get the exact timezone name, we will use the Internationalization API − DOCTYPE html> Timezone document.getElementById("test").innerHTML = Intl.DateTimeFormat().resolvedOptions().timeZone; Output Get the Timezone (Difference between UTC ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
11K+ Views
We can easily allow only numbers in a textbox using jQuery. Under the keyup() set the code for allowing only number values so that the textbox never accept strings. We will see two examples − Allow Only Numbers in a TextBox using jQuery replace() Allow Only Numbers in a TextBox using jQuery fromCharCode() Allow Only Numbers in a TextBox using jQuery replace() In this example, we will see how to allow only numbers in a TextBox using jQuery replace(). We must set the code under the keyup to allow only numbers while typing, else the textbox will not ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
7K+ Views
To embed images encoded with Base64, use the img element. This prevents the page from loading slowly and saves the web browser from additional HTTP requests. Set the base64 image in the src attribute of the . Let’s say we have the following image − Note − The bigger the image, the more will its bease64 code For Base64, we will consider the Data URL of the image, which is placed in the src attribute. The Data URL has two parts − The 1st part is the Base64 encoded image. The 2nd part is the Base64 encoded ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
395 Views
No, we cannot have the same ID for different elements in HTML. IDs have to be unique in the entire HTML page. Even the official HTML standards suggest the same − Using the unique id attribute Example Let us see an example. Here, we have used the id attribute − DOCTYPE html> #myHeader { border: 3px solid violet; background-color: blue; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
3K+ Views
In HTML, placeholder attribute is present for creating a placeholder, but unfortunately it isn’t available for the select box. Create Placeholder for select We can use the option tag to define an option in a select list. The value attribute of the option tag is used for this. Here we have set List of Technologies as the placeholder text − List of Technologies Example Let us now see the complete example − DOCTYPE html> select { appearance: ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
3K+ Views
The jQuery attr() method is used to change the href attribute for a hyperlink. Query attr() method is used to fetch the value of any standard attribute from the matched HTML element(s). Let us see an example. First, get the current URL − var httpUrl = $(this).attr("href"); Create a new URL by replacing the above using the replace() − var httpsUrl = httpUrl.replace("http://", "https://"); We will convert the https links to link using what we saw above − Tutorialspoint Tutorialspoint Courses Tutorialspoint EBooks Tutorialspoint QA Example Let us see the complete example to change the ... Read More