+ 1
Can you put jquery in html?
I have been trying to understand this new language jquery. is there any chance to be able to add the js code in html with jquery configuration (code)? For example: html code ------------------------- <script src="https://code.jquery.com/jquery-3.1.1.js"></script> JavaScript code -------------------------- $(function() { $("#item").click(function() { $("#submenu").slideToggle(500); }) how would u get the JavaScript code and place it in html without the code failing?
4 Respostas
+ 4
You should write it inside a <script></script> tag.
+ 2
Mmm... hard to say... Here's an example:
https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_hide_p
+ 1
sweet thx @álvaro that help a lot and its now working in html xD idky I stuck <script type="javascript/text"> force of I guess, can't believe I didn't figure this one out by myself anyway thx again for helping
0
I've tried that and it didn't work @álvaro