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
-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
  • 771
  • 3
  • 14
  • 33
-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
  • 199
  • 5
  • 19
-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
  • 5
-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,150
  • 1
  • 9
  • 16
-1
votes
2 answers

When is it preferable to use `attr()` instead of `.prop()`?

(Note: While it may be tempting to say this is a duplicate of .prop() vs .attr(), I do not believe it is. That post does a fantastic job explaining the difference between .prop() and .attr() but does not state definitively when one is preferable…
Derek Henderson
  • 9,388
  • 4
  • 42
  • 71
-2
votes
3 answers

how make [Object object] to string in react

Question: export function Main () { return (
Some

generation

here}` )} `}/>
) } I want output text as in image (when…
-2
votes
1 answer

React Typescript Circular Dependence and import

I have a union type setup in the parent export type Students = "fresher" | "secondYear" | 'finalYear' | 'postGrad'; Causing a circular dependency, now the obvious solution is to define this type in an external file. Is there a work around where the…
TommyD
  • 913
  • 3
  • 17
  • 32
-2
votes
1 answer

.prop() not doing anything to target radio buttons

I'm trying to uncheck a group of 2 radio buttons.
Vereonix
  • 1,341
  • 5
  • 27
  • 54
-2
votes
1 answer

Check if input is checked ONLOAD and ONCHANGE

My javascript skills are subpar so I won't post what I've already tried with jQuery. I can say, however, that I've tried lots of things and nothing worked completely. The scenario is simple: I have several containers. All of them with a checkbox…
ronaldpoi
  • 191
  • 1
  • 7
-2
votes
2 answers

.prop("checked", false) doesn't work perfectly

In order to uncheck a radio button with Jquery... I use this code : $('input[type=radio][name=belvg_customerattributes_particulier]:checked').prop("checked", false); This code works but visualy I still see the button on checked. I tried this :…
Sébastien
  • 87
  • 1
  • 3
-2
votes
1 answer

Cannot access element created after page load using jQuery

I have a site which has an element with a specific id. I would like to get the href attribute using jQuery. I am trying to do the following: alert($("#id").prop('href')); But it says 'undefined'. I tried setting the timer function as well as using…
-3
votes
3 answers

Undefined when trying to use addClass on $(this) anchor tag

function showImage(imageSrc) { $('a.slideTabLinkBlock').removeClass('active'); alert($(this).attr('class')); $(this).addClass('active'); }
1 2 3
23
24