Questions tagged [prop]

The prop() function was added in jQuery 1.6 library. It returns a property for the first element of the matched set.

The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping construct such as jQuery's .each() or .map() method.

The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

293 questions
0
votes
2 answers

Disable opposite input if I type into another of a pair

How do I disable one input field if I type into another out of a pair and then if I removed the input by hitting backspace for example so there is nothing in the input field reenable the second input field and vice versa. Code I have so far is below…
Ben Paton
  • 1,414
  • 8
  • 32
  • 55
0
votes
2 answers

Choosing an option to check/uncheck checkboxes not working?

I have a dropdown of users with different permissions. The different permissions for the users are view, edit or delete. When choosing the user from the dropdown, the checkboxes should update according to which permissions they have. I've tried…
triplethreat77
  • 1,202
  • 6
  • 29
  • 61
0
votes
1 answer

jQuery - Reset radio buttons on click

jsfiddle http://jsfiddle.net/cCBUh/2/ Information I have 3 choices. Only click on the labels, not on the radio buttons. When clicking on the different labels, different radio buttons are checked. In the console it says "clicked" when ever a label…
Jens Törnell
  • 18,167
  • 36
  • 100
  • 168
0
votes
3 answers

If clicking something else - change prop / jQuery

if clicking something else, the last input (which was clicked) should be readonly -> true again. here is my code: