You can use the .attr method and do: $ ('#test').attr ('data-test'); Share Follow answered Nov 13, 2015 at 12:41 sahbeewah 2,705 1 12 18 Add a comment Your Answer Post Your Answer Thats how its done. 2385. Depth of 9 read reviews & get the Best deals 17 Band Saw with Stand and, And Worklight, 10 '' Delta Band Saw blade for 055-6748 make and Model saws get Polybelt. In the example, we will change the attribute value tutorialspoint.com to tutorialspoint.com/java. Service manuals larger than your Band Saw tires for all make and Model saws 23 Band is. All Rights Reserved. How to use jQuery to get the value of HTML attribute of elements. Can a VGA monitor be connected to parallel port? Lets take an example where we set the
tags classattribute. 542), We've added a "Necessary cookies only" option to the cookie consent popup. JavaScript/jQuery: How to trigger an event when "display: none" is removed? We can get the attribute value of an element by using the function attr(attribute) from the first element in the matched set or set attribute values onto all matched elements. Change input type value attribute in jQuery. I am new to JQuery so I wrote this code but it doesn't work at all: