Questions tagged [attr]

This tag should be used for attribute related issues.

An attribute is a specification that defines a property of an object, element, or file. It may also refer to or set the specific value for a given instance of such.

1255 questions
-2
votes
2 answers

Toggle attr of svg with jQuery

I understand that I cannot use addClass or removeClass with SVG and that I must use attr. But how can I toggle an attr of an SVG using jQuery. See my fiddle. I am trying to toggle the rotation of the arrow on click (see the commented out portion…
JordanBarber
  • 2,041
  • 5
  • 34
  • 62
-2
votes
1 answer

Is it possible to set ID and Class of an element using jQuery method attr()?

$("selector").attr("id","idname"); Is it possible to use above for setting ID or Class of an element.
Raghul Rajendran
  • 486
  • 2
  • 7
  • 25
-2
votes
2 answers

jquery "on" properties for div get "attr" not working?

jquery on click get attr
click me