<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
	<script src="jquery-1.11.3.js"></script>
	<script>
		window.onload = function(){
			$("#btn").click(function(){
				//1、获取 uname 的值
				var uname = $("#uname").val();
				//2、将uname的值显示在#show中
				$("#show").html(uname);
				//3、设置#show的css样式
				$("#show").css({
					"font-size":"32px",
					"color":"red",
					"background":"yellow",
					"font-weight":"bold"
				});
			});
		}
	</script>
 </head>
 <body>
  <p>
		用户名:
		<input type="text" >
		<button >显示</button>
	</p>
	<div ></div>
 </body>
</html>

jQuery-文本框内容显示在页面

相关文章:

  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-02-05
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案