Tell me how to get the id of the form? been here like that doesn't come out
console.log($("form").attr("id")); Throws undefined
Everything works on Yii2 js scripts at the end of the body
Tell me how to get the id of the form? been here like that doesn't come out
console.log($("form").attr("id")); Throws undefined
Everything works on Yii2 js scripts at the end of the body
Try this:
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> window.onload = function() { console.log($("form").attr("id")); } </script> </head> <body> <form id="test_form"> </form> </body> </html> Source: https://ru.stackoverflow.com/questions/942044/
All Articles