Simplest JQ implementation

<! DOCTYPE html > 
< html > 
< head > 
< meta charset ="utf-8"  /> 
< title ></ title > 
< script src ="js/JQ3.3.1.js" ></ script > 
< script type ="text/javascript" > 
function fun(){
 var msgValue = $(msg).val(); // val() function is used to get the content 
console.log( "The input content is: " + msgValue)
}


</script>
</head>

<body>
输入消息:<input type="text" name="msg" id="msg" />
<input type="button" value="选择" onclick="fun()"/>
</body>
</html>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324525440&siteId=291194637