I use Java spring MVC framework and I want to implement a jQuery script function to hide 'p' bracket when I click a button.
A variant to the file my-query-page.jsp and jq_functions.js can be seen below
$(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); });
<!DOCTYPE html> <html> <head> <title>this is me learning jQuery</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <!-- THIS DOESN'T WORK --> <script src="/resources/js/jq_functions.js"></script> </head> <body> <h2> this is me learning jQuery</h2> <p>this is a line of text</p> <p>this is a second line of text</p> <p>this is a third line of text</p> <button>Hide</button> </body> </html>
2.1m questions
2.1m answers
60 comments
57.0k users