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.

347 questions
0
votes
5 answers

jquery on certain option select on first select list, enable second select list

I'm trying to solve a situation where you have two select lists and on first and second option from first list, second list gets enabled. Ok, I have #decide and #day select lists, #day is disabled by default. If User would select option yes: or…
dzordz
  • 2,277
  • 13
  • 51
  • 74
0
votes
1 answer

jquery check all / uncheck all toggle button not dynamically changing value after php post of form

I have been trying to get a button that toggles its value (from "check all" to "uncheck all") based on if all the checkboxes of a certain class are checked or not. Here is my HTML (well, PHP) of the simple form with checkboxes, you can see I'm…
gamehendgeVA
  • 149
  • 1
  • 3
  • 15
0
votes
2 answers

How do I use prop. to only be applied to the element clicked?

I am creating a payment form, part of which the user can select credit card or paypal. I am having issues with the display function. Should I be creating a new function for each element? This is what I have:

Billing Infomation

First…
0
votes
2 answers

How do I use jquery's prop() to set the attribute of a checkbox?

I want to use prop() to set the attribute of a checkbox to checked. When I use prop("checked",true) I can visually see that the checkbox is checked, but if I look at the HTML there is no attribute value called checked. For example:
Nancy Collier
  • 1,469
  • 4
  • 17
  • 21
0
votes
2 answers

Jquery Get longdesc Prop

I need to get the longdesc from an image. I have tried: $(this).prop('longdesc'); but it returns undefined.
User970008
  • 1,135
  • 3
  • 20
  • 49
0
votes
2 answers

.prop, .attr not working when trying to disable asp:CheckBox

I have a bunch of asp:checkboxs. Most of them have a class of "restricted" and all of them have clientIdMode='static'. I have a separate checkbox with id='other'. When this box is clicked, I want the boxes with class='restricted' to be disabled.…
BearSkyview
  • 385
  • 1
  • 8
  • 24
0
votes
3 answers

jquery exclude div from function

I have some jquery that unchecks all the checkboxes and then if one gets checked then it will uncheck all the others! I want to exclude a div on the page with some checkboxes from this! The div to be excluded has…
user2159909
  • 47
  • 1
  • 5
0
votes
1 answer

jquery loading photo into div then fadein

I'm trying to create a gallery, I'm trying to load an image into a div, and when it's finished loading have it fade it, though it isn't quite working. If I remove the display:none the image does load into the div, it's the fadeIn function that's…
loriensleafs
  • 2,205
  • 9
  • 37
  • 71
0
votes
1 answer

Toggling a checkbox to append to div - checkbox stays unchecked

I'm building my first little jquery To Do List, each list item has a checkbox, and when this is checked it is moved to the Done div. This works as expected, it's just that the checkbox is always unchecked. I've experimented with .prop() but it…
0
votes
3 answers

Storing multiple selectors in a single variable

I have a piece of code that handles clicks on images that represent buttons. If that image is clicked, its corresponding image will appear to the user. By selecting the multiple IDs of the images, the vode below works perfectly…
Navigatron
  • 2,065
  • 6
  • 32
  • 61
0
votes
2 answers

condition for input field and checkbox

how can i create a condition for multiple checkbox! Input Field ID =" INsrvOtr " CheckBox ID = "INsrv" let's say that the that the user has two options,either put a value on the input field or choose any value from the checkbox but he can only…
telexper
  • 2,381
  • 8
  • 37
  • 66
0
votes
5 answers

Why the jquery prop() method can not get the the element's value property

I have several li element in page:
  • a
  • b
  • c
  • d
  • the I want get the value property when hover on it: $(function () { $('li').live('mouseover', function () { …
    hh54188
    • 14,887
    • 32
    • 113
    • 184
    -1
    votes
    1 answer

    In React, how do I render a stateless component that is passed in as a prop?

    I want to render a component based on whetehr a user is logged in The PrivateRoute…
    Dave
    • 15,639
    • 133
    • 442
    • 830
    -1
    votes
    1 answer

    React is duplicating my object value giving me a Warning: Each child in a list should have a unique "key" prop

    Im trying to make a navigation bar for a website and it's giving me the "Warning: Each child in a list should have a unique "key" prop." inside my props.dropList.map I have two files: NavigationItems.js -> where I render my navigation bar const…
    Rui Castro
    • 108
    • 7
    -1
    votes
    1 answer

    Is there any way to check the status of props when passing data from parent to child component

    I have been troubled by a question for a long time. Now I am using Vue.js to develop a web project. What I want to do is to pass data from parent to child component. However, the child component's main program would run only after the props data was…