adspace
Answer Posted / Balwant Kumar Singh
To set attributes of an element using jQuery, you can use the `attr()` method. Here is an example:
```html
<div id='myDiv'>This is the div</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('#myDiv').attr('title', 'New Title');
});
</script>
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you install/use jquery in a project. What is the minimum setup needed to start using jquery.
How to always reference latest version of jquery?
What is the minimum setup needed to start using jquery.
How to validate email using jquery?
Do you have plans for a new jquery plug-in or something else we should look out for? Where to from here for the imgpreview plugin?
How can jquery library be added to pages?