wmi-parprog/05_html_jQuery/web4.html

29 lines
550 B
HTML
Raw Permalink Normal View History

2024-03-25 17:52:53 +01:00
<html>
<header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</header>
<body>
<h1>IMPORTANT TITLE <b>BOLD</b></h1>
<h1 id="abc">TITLE 2</h1>
<h1 class="c1">TITLE 3</h1>
</body>
<script>
alert('Hello');
alert($('h1').html());
alert($('#abc').text());
alert($('.c1').text());
$('.c1').html('NEW TITLE');
$("h1").each(function(index) {
alert(index + ": " + $(this).text());
});
$('#abc').remove();
</script>
</html>