href attribute selector – jQuery

$(“[href]”) – selector is used to select the all elements which have attribute “href”.

Syntax : href attribute selector

href attribute selector – jQuery Example

<!DOCTYPE html>
<title>href attribute selector - jQuery Example</title>
 <script type="text/javascript" src="">
<script type="text/javascript">
          $("[href]").css("border","4px solid red");
<a href="javascript:void(0)" id="demo"> 
Click Me
  <li> <a href="javascript:void(0)">First Item</a> </li>
  <li> <a href="javascript:void(0)">Second Item </a></li>
  <li> <a href="javascript:void(0)">Third Item </a></li>

Try it »


Add Comment

📖 Read More