javascript - button in jquery and jscript -
i trying understand difference between jquery , javascript. , apologies if silly question.
this attempt @ jquery. on pressing button text in <p>
should change requested. cannot work. http://jsfiddle.net/qahda/7/
this javascript attempt. cannot work either http://jsfiddle.net/alhb8/1/
can please me
- my jquery above working.
- my jscript above working.
- i trying point write jquery in such way written in javascript. can me this?
thanks
edit
thanks answers/corrections: looking part 3 enter link description here part 1 using javascript,i think. in future should careful,using left hand pane, include jquery library , make sure jsript wrapped in head/body
jquery
you need include jquery library page selecting jquery version in first dropdown in left panel
demo: fiddle
js sample
the problem since function defined within onload callback, not available in global scope causing error saying
uncaught referenceerror: myfunction not defined
the solution add script body elements, instead of inside onload callback selecting no wrap - in <body>
in second dropdown in left panel
function myfunction() { alert("hello world!"); }
demo: fiddle
Comments
Post a Comment