0

When a page loads, how can I change a specific HTML element's parameters using jQuery? For example, in the following HTML, I would like to change type="submit" to type="button" and src="image1.jpg" to src="image2.jpg"

<form class="edit" action="" method="post">
    <input type="text" name="firstName">
    <input type="submit" value="Submit" class="thisOne">
</form>
<img src="image1.jpg">
GTS Joe
  • 3,612
  • 12
  • 52
  • 94

1 Answers1

1
$(window).load(function() {
    $('input[name=firstName]').attr('type', 'button');
    $('img').attr('src', 'image2.jpg');
});

Just one example.

Faiz Ahmed
  • 1,083
  • 8
  • 16