Professional Documents
Culture Documents
Chuong 06 GioiThieuJQuery
Chuong 06 GioiThieuJQuery
<header>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js”>
</script>
</header>
Truy cập vào theo Class
document.getElementsByClassName(“class”)
$(“.class”)
Truy cập vào theo ID
document.getElementByID(“ID”)
$(“#ID”)
Lấy giá trị theo ID
document.getElementByID(“ID”). innerHTML
$(“#ID”).html()
Lấy giá trị trên Input
document.getElementByID(“ID”). value
$(“#ID”).val()
Gán giá trị trong input
$(“#ID”).val(“abc”)
Lấy giá trị theo ID
$(“#ID”).html(“abc”)