We help IT Professionals succeed at work.

Convert jquery link to an image button.

birwin asked
Medium Priority
Last Modified: 2012-05-06
I am using the following link to call up a page: <a href="javascript:sortSummaries('views')">Sort By Views</a>

The jquery function this triggers is: function sortSummaries(id) {$("#summaries").load("browse_content.php?sort="+id+"");}

How can I convert this to use an image button?

(Note: for some reason EE removes the plus signs on either side of  id in the function)

<a href="javascript:sortSummaries('views')">Sort By Views</a>
function sortSummaries(id) {$("#summaries").load("browse_content.php?sort="+id+"");}

Open in new window

Watch Question

You want to change your link to a button?

If so

instead of

<a href="javascript:sortSummaries('views')">Sort By Views</a>


<input type="image" src="x.jpg" onclick="sortSummaries('views')"/>

Another example:


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Thank you. This worked perfectly.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.