Select and hide all elements with an href attribute. - Javascript jQuery

Javascript examples for jQuery:Hide

Description

Select and hide all elements with an href attribute.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("[href]").hide();
});/* w  ww .  ja  v a 2 s.c o m*/
</script>
</head>
<body>

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<a href="http://java2s.com/">HTML Tutorial</a>
<a href="http://java2s.com/">CSS Tutorial</a>

</body>
</html>

Related Tutorials