返回jQuery操......登陆

jQuery操作属性的方法

文昌2018-12-17 18:35:09242
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<title>jQuery获取/改变CSS</title>
		<script src="jqurey/jquery-3.3.1.js"></script>
		<style type="text/css">
			.bb{color:red;}
		</style>
	</head>
	<body>
		<script type="text/javascript">
			$(document).ready(function(){
				// $('button').click(function(){
				// 	$('span,b,p').toggleClass('bb')
				// })
				// console.log($('span').text())
				// $('span').text('hello word')

				// console.log($('p').html())
				$('p').html('<h1>helloworld!</h1>')
				$('input').val('我是被修改的值')
				console.log($('input').val())
			})	
		</script>
		<span>大家好</span>		
		<b>欢迎来到</b>
		<p>PHP中文网</p>
		<button>点击切换</button>
		<input type="text" name="" value="我是元素的值">
	</body>
</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送