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>