본문 바로가기

sundries

3-8 removeAttr()

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

<script src ="../js/jquery-3.2.1.js"></script>

</head>

<script>

/* removeAttr(name) 메소드 : 문서 객체의 속성을 제거*/

$(function(){

$('h1').removeAttr('data-index');

});

</script>

<body>

<h1 data-index="0">Header-0</h1>

<h1 data-index="1">Header-0</h1>

<h1 data-index="2">Header-0</h1>


</body>

</html>