- 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
Amit D has Published 118 Articles
Amit D
173 Views
To get the value of html attribute, use the val() method.ExampleYou can try to run the following code to learn how to use jQuery to get the value of HTML attribute of elements:Live Demo $(document).ready(function() ... Read More
Amit D
858 Views
Use the attr() method to add an attribute into specific HTML tags in jQuery.ExampleYou can try to run the following code to learn how to add an attribute into specific HTML tags:Live Demo $(document).ready(function(){ $(document).ready(function(){ $("button.button1").attr("myid", "myvalue"); ... Read More
Amit D
228 Views
To use jQuery selectors on custom data attributes, you can use contains, starts with, and ends with for the HTML data attributes.ExampleOther than that, you can try to run the following code to learn how to use jQuery selectors on custom data attributes using HTML5:Live Demo ... Read More
Amit D
1K+ Views
To get the elements with an ID that ends with a given string, use attribute selector with $ character.ExampleYou can try to run the following code to learn how to to use jQuery selector for the elements with an ID that ends with a given string. Let’s say we are ... Read More
Amit D
718 Views
To get a DOM Element from a jQuery Selector, use the $('#element').get(0). This returns the DOM element.ExampleYou can try to run the following code to learn how to get a DOM Element from a jQuery Selector. For our checkbox example, get a DOM element like the following code:Live Demo ... Read More
Amit D
629 Views
To exclude first and second element from jQuery, use the slice() method.ExampleYou can try to run the following code to exclude first and element from jQuery:Live Demo $(document).ready(function(){ $('p').slice(2).css('font-size', '24px'); }); Java C++ Ruby Groovy
Amit D
141 Views
The .not() is used to select all elements except an element, which can be specified.ExampleYou can try to run the following code to learn how to use .not() with jQuery selector.Live Demo $(document).ready(function(){ $("p:not(.myclass)").css("background-color", "red"); }); Heading This is demo ... Read More
Amit D
3K+ Views
ExampleYou can try to run the following code to write a jQuery selector to find links with # in href. Here, ^ is used to find links starting with # in href.Live Demo $(document).ready(function(){ $('a[href^="#"]').click(function(){ alert('Success! Selected link starting with # ... Read More
Amit D
292 Views
To escape square brackets in jQuery selectors is quite easy. Let’s see with an example of escaping the brackets in the name of the box.ExampleWhatever you will select, will get added to the textarea on button click.Live Demo $(document).ready(function() { $("#addnow").click(function () ... Read More
Amit D
76 Views
The slice(start, end) method selects a subset of the matched elements. The following are the parameters of the slice() method:start − Where to start the subset. The first element is at zero. Can be negative to start from the end of the selection.end − Where to end the subset excluding end element. ... Read More
To Continue Learning Please Login
Login with Google