티스토리 뷰
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript">
//window.onload와 같은 기능
$(document).ready(function(){
// href중에서
var xx = $("[href]").filter("[href!='xxx']"); // . =클래스 / # = ID
console.log(xx);
//1. href 속성 []
var x = $("[href]");
console.log(x);
//2. href=값
var x2 = $("[href='xxx']");
console.log(x2);
//3.href!=값
var x3 = $("[href != 'xxx']");
console.log(x3);
//4. href^=값 ==> 값ㅇ로 시작하는
var x4 = $("[href^='http']");
console.log(x4);
//5. href$=값 ==> 값으로 끝나는
var x5 = $("[href$='com']");
console.log(x5);
//6. href*=값 ==> 값이 포함된
var x6 = $("[href*='korea']");
console.log(x6);
});
</script>
</head>
<body>
<a href="xxx">xxx</a>
<a href="http://www.naver.com" class="kkk">aaa</a> <!-- . =클래스 / # = ID -->
<a href="https://www.daum.net" id="xyz">bbb</a>
<a href="http://www.naver.com" id="xyz2">ccc</a>
<a href="https://korea.com" class="kkk">ddd</a>
</body>
</html>
'it' 카테고리의 다른 글
| 데이터베이스 언어 (0) | 2023.03.22 |
|---|---|
| 태그값 탐색 5 (0) | 2023.03.20 |
| PHP 구구단 (0) | 2023.03.14 |
| 개발환경 구축 -2 / JSP 개발환경 구축 (서버구축) (0) | 2023.03.13 |
| JSP EL (0) | 2023.03.12 |
