Forum Moderators: open

Message Too Old, No Replies

Find something by Attribute with JQuery

         

rwilson

9:06 pm on Jul 20, 2011 (gmt 0)

10+ Year Member



I have a button that does not have a unique class or id but it does have value="Download". I can't edit this button.

How would I use JQuery to find this button then edit the css?

Any help would be greatly appreciated!

daveVk

11:08 pm on Jul 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try

$('[value="Download"]')

rocknbil

5:01 pm on Jul 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or . . . if that value may change, descendant selection. If there are any parent elements with ID's or other handles,

<form id="some-form">
<input type="submit" value="Download Now">
</form>

$('#some-form :submit')

Use :button if it's a button. Which it shouldn't be, I'd think.