Top "Attr" questions

This tag should be used for attribute related issues.

.prop() vs .attr()

So jQuery 1.6 has the new function prop(). $(selector).click(function(){ //instead of: this.getAttribute('style'); //do i use: $(this).prop(…

javascript jquery dom attr prop
How to change href of <a> tag on button click through javascript

How to change the href attribute value of an <a/> tag through Javascript on button click ? <script …

javascript href attr
jquery: get value of custom attribute

html5 supports the placeholder attribute on input[type=text] elements, but I need to handle non-compliant browsers. I know there …

jquery custom-attributes attr
jQuery .attr("disabled", "disabled") not working in Chrome

Not sure why this isn't working. When people click the 'edit' button of my application, the disabled textfields become editable: $("#…

jquery google-chrome cross-browser attr jquery-attributes
How to find elements with 'value=x'?

I need to remove element that have value="123". I know that all elements with different values are located into #attached_…

jquery find attr
Toggle input disabled attribute using jQuery

Here is my code: $("#product1 :checkbox").click(function(){ $(this) .closest('tr') // Find the parent row. .find(":input[type='text']") // Find …

jquery toggle attr
Jquery - animate height toggle

I have a 10px bar along the top of the screen that, when clicked, I want it to animate to …

jquery height jquery-animate attr
Setting new value for an attribute using jQuery

I am trying to set a new vale of a custom attribute of a div using attr(). I found out …

javascript jquery html attr
jQuery attr('onclick')

I'am trying to change "onclick" attribute in jQuery but it doesn't change, here is my code: $('#stop').click(function() { $(…

javascript jquery onclick attr
Get href attribute on jQuery

I have some table rows <tr class="b_row"> <td> <div class="cpt"> <…

jquery get href each attr