0

Using a JavaScript+jQuery I am manipulating image widths as so:

JAVASCRIPT

var imageWidth = .9 * $(window).innerWidth();
var imageHeight = .6 * $(window).innerWidth();

$("document").ready(function(){
    $(".class").css("width",imageWidth);
    $(".class").css("height",imageHeight);
});

But I also am using this to give my submit button a PHP robust image

CSS

 form input[type=submit]{
     background: url("xyz.png") no-repeat center center;
     width: 90px;
     height: 60px;
     border: none;
     color: transparent;
     font-size:0;
 }

(more on this css technique at www.suburban-glory.com/blog?page=140)

My question is not very difficult but I can't find the information I need. How do I call the form input [type=submit] in JavaScript so I can manipulate the image used for the submit button? (as you can see in the examples I was simply calling CSS classes)

1 Answer 1

3
$('form input[type="submit"]').css('background-image', 'url("xyz.png")');
Sign up to request clarification or add additional context in comments.

2 Comments

by the way I don-t want to change or set the url via javascript, I am changing the css height and width properties. I'll substitute the last phrase..
well you can change any css property by using the css method in jquery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.