When running this code in my html, I get an object expected error and cannot get any button to function. This is my code.
<button type="button" id="button">Click</button>
<script language="javascript" type="text/javascript">
$("button").click(function () {
$("p").addClass("highlight");
})
</script>
The debugger say that the error starts on $(“button”).click(function () {
This is my entire html:
I cant get both buttons to change colors, they just turn the color yellow. This does seem to somewhat work on this fiddle site, however I cannot run this from internet explorer because I get the object expected error. When I say run it from internet explorer, I mean open the html page file in the browser.
Thanks
http://jsfiddle.net/4vx7J/
EDIT: try this
http://jsfiddle.net/J7QFy/11/