i have just figured this out http://jsfiddle.net/bUjx7/105/
but when i copy the code into dreamweaver it does not work!
I never use jquery so how do you add the library as i know it's done automatically in jsfiddle? Is it with a link in the head tag? I tried adding
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</head>
but this doesnt work is it something to do with the onLoad?
I really don't know, I know this is a simple problem but hopefully once i know, i wont ever have to ask again
The default value of the second dropdown in jsFiddle is "onLoad". This means any javascript you write in the script panel will be executed in an onLoad
event handler. Since you're using jQuery, you can reproduce this behavior by using a $(document).ready
block*:
$(document).ready(function () {
// your code from the jsFiddle javascript panel
});
*onLoad and document ready are not the same thing, but either will work for you.