TIMEX
TIMEX

Reputation: 271824

How to use JQuery to get information about certain tag?

For example, one of them has this:

<div id="hat" re="mouse" > text here </div>

$(.#hat).re = ??????

Upvotes: 1

Views: 69

Answers (2)

Colin
Colin

Reputation: 2502

$('#hat').attr('re');

will get it

$('#hat').attr('re', 'blah'); 

will set it

Upvotes: 3

Matt Kauffman
Matt Kauffman

Reputation: 21

If you want to update the value of the re attribute simply write this:

$('#hat').attr('re', 'newValue');

Upvotes: 2

Related Questions