Problem about setting up a function in Script
Hello everybody.
I came across this script:
<script>
$( "<div/>", {
"class": "test",
text: "Click me!",
click: function() {
$(this).toggleClass( "test" );
}
})
.appendTo( "body" );
</script>
Is the script above, setting up a function for the newly added "Click me!", in that it is supposed to disappear from the page it is on, when someone clicks on it? if not, what should be expected from this script; I "tried this code out"; and "Click me!" is unfunctional.
Thank's a lot!