2👍
✅
Things need to be taken care:-
1.Add a jquery library before any jQquery code (otherwise jQuery code will not executed).
2.Either put your script code at the end of the page or change it like below :-
$(document).ready(function(){
$(".pure-toggle-label").click(function () {
console.log("Hello World");
});
});
0👍
Js code (and jquery in your case ) will be executed as soon as the js interpreter find the snippets to execute… if the code to be executed is invoked before any js lib is loaded then you will get an “… not found error”… on the other hand most of initializing functions are anchored to the onload method in the site, this is because most jquery functions are related with dom elements that must be properly loaded before getting manipulated
- [Answered ]-Dynamically add input fields and save data to Database using django
- [Answered ]-Is there a way to have dictinary-like field in Django model?
- [Answered ]-Manipulating Django form to show the correct validation error(s)
- [Answered ]-Select related of selected related
- [Answered ]-Django: assert 'Many-to-many' relation exists in test
Source:stackexchange.com