Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

JQuery Get/Find form button using text value

Posted on 2013-01-17
1
313 Views
Last Modified: 2013-01-17
Hello,

If I have the following button in my page

<input type="button" class="btn" value="Find"  />

This button is loaded from a 3rd party application and does not have an id.
If it did have an id (e.g. "testb") I could use something like the following to find my button and set it's background image

$('[id$="testb"]').css("background-image", "url(http:www.mytest.com/myTest.jpg)");

However my button will never have an id and there is also the possibility that more than one button on the page therefore I can't search by class or type.

Can I search using the value"Find" as this will be unique?

Thanks in advance.
0
Comment
Question by:speedygonzalez
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 38787058
Try this :
$(':button[value="Find"]').css("background-color", "red");
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Scroll To Top 5 38
VBScript on Html 15 47
I have a few questions about using the Google Developer's Console. 4 38
jQuery dialog box help 2 17
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question