Home > front end >  Js after the page is loaded, for less than the input value in js, ready and onload all not line, wan
Js after the page is loaded, for less than the input value in js, ready and onload all not line, wan

Time:09-17

 



//not used the onl oad
Window. Ready=function () {
Alert ($(" url "). Val ());
};
</script>

CodePudding user response:

Selector using the wrong
Alert ($(" input [name='url'] "). The val ());

CodePudding user response:

To pay more attention to reading wrong, usually can find problems
Also, make sure to remember introducing Jq file

CodePudding user response:

Suggest another look at JQ or JS selector

CodePudding user response:

 
Native js method
Window. The onl oad=function () {
Alert (document. QuerySelector (" input [name='url'] "). The value).
}

Jquery method
$(function () {
Alert ($(" input [name='url'] "). The val ());
});
  • Related