javascript - Display div on click with jQuery -


i want create <div> (display: none) when click on button, <div> should show itself.

but error:

parse error: syntax error, unexpected '(', expecting t_variable or '$'

when use code:

$('body').click(function () {   $('#editor_form').hide(); });  $('#buttondiv').click(function (e) {   $('#editor_form').sho`enter code here`w();   e.stoppropagation(); }); 

the error got php 1 writing javascript (with jquery).

your javascript code need placed inside <script></script> tag on html file or directly on js file included in html file.

maybe if have html , php on same file, forgot php closing tag ?> before starting write js code.

moreover, careful, have placeholder cause error on line :

$('#editor_form').sho`enter code here`w(); 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -