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

.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
  • 365
  • 1
  • 6
  • 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
  • 4
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,015
  • 9
  • 32
  • 69
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
  • 1,869
  • 6
  • 29
  • 52
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,111
  • 8
  • 33
  • 61
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
    • 13,085
    • 30
    • 99
    • 174
    -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…
    -1
    votes
    1 answer

    Can't find variable: ReactPropTypes

    Hello i'm trying setup an old code react native version>0.57. Whenever i'm trying to run i'm getting this error Can't find variable: ReactPropTypes. i checked the whole code everywhere even i checked the node module nothing is wrong present i don't…
    Bram Smith
    • 21
    • 4
    -1
    votes
    1 answer

    bootstrap4C change function with a delay no function?

    I'm using Bootstrap4C UI, and I want to cancel the checked property of a particular element after some delay time. You can see the options I have tried on next example: $('.button_onoff').change(function() { console.log("pay_onoff change"); …
    robspin
    • 637
    • 10
    • 25
    -1
    votes
    1 answer

    Uncaught Error: The `style` prop expects a mapping from style properties

    According to error I pasted Home components please have a look import React, { Component } from 'react'; import { getFromStorage ,setInStorage } from "../../utils/storage"; import 'whatwg-fetch'; // import TodoList from "./TodoList" class…
    Mohsin
    • 189
    • 4
    • 17
    -1
    votes
    1 answer

    Why is the empty result turning?

    Firstly, my English is bad, I'm sorry. I want textbox (in Form2.cs) text to displaying MainForm.cs When I apply the following codes, displaying blank message. MainForm.cs private void btnFilitre_ItemClick(object…
    -1
    votes
    1 answer

    I receive an error when trying to pass a component/prop into a parent component

    I'm new to react, so this is likely a beginner's error. Here's my code that I'm working on: https://github.com/tylerehc/hrs/ It runs fine in that version--that is, the browser renders 'hello cow'. However, when I try to use a second component and…
    taylorhamcheese
    • 43
    • 1
    • 10
    -1
    votes
    3 answers

    How do I use the propful aspect in Visual studio?

    How do I use the propfull tab tab gadget in visual studio? Class Foo { public int regirsterR0 { get { return R0; } set { R0 = value; } } } How would I use the get and set methods from another class? Let's say this method is…
    Dragael
    • 9
    • 3
    -1
    votes
    3 answers

    Which method should i use out of this(.attr() vs .prop()) for performance and usage?

    $(selector).click(function(){ //instead of: this.getAttribute('style'); //do i use: $(this).prop('style'); //or: $(this).attr('style');}) I've worked on this and put my solution on below "fiddle". Pls Check it... See this fiddle:…
    Joe Mike
    • 1,090
    • 9
    • 16
    1 2 3
    19
    20