0 works

Select Element with ID using jQuery


dashboard

Posted by @mishka #javascript

Step 0: Add ID to an HTML element

<h2 id="lastHeading">Thank you for reading</h2>
content_copyCopy to Clipboard

Step 1: Select with ID tag in script or javascript file

<script>
	var blogHeaders = $("#lastHeading");
</script>
content_copyCopy to Clipboard

Make sure jQuery has been already added to project.


>> Browse more code snippets

more_vert