homepage Welcome to WebmasterWorld Guest from 54.242.126.9
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Find something by Attribute with JQuery
rwilson



 
Msg#: 4341946 posted 9:06 pm on Jul 20, 2011 (gmt 0)

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

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4341946 posted 11:08 pm on Jul 20, 2011 (gmt 0)

Try

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

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4341946 posted 5:01 pm on Jul 21, 2011 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved