

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the value of an attribute in javascript?
To change the value of an attribute in JavaScript, you can try to run the following code −
Example
<!DOCTYPE html> <html> <body> <img id="HTML5" src="https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg" width="200" height="150"> <script> document.getElementById("HTML5").width = "250"; </script> <p>Image width updated</p> </body> </html>
- Related Questions & Answers
- How to change the value of an attribute using jQuery?
- How to get the value of the usemap attribute of an image with JavaScript?
- Value of the class attribute node of an element in JavaScript?
- How to get the value of the usemap attribute in JavaScript?
- How to extract the attribute value of an element in Selenium?
- Change input type value attribute in jQuery
- How to get the value of the hreflang attribute of a link in JavaScript?
- How to search the value of the href attribute of a link in JavaScript?
- How to get the value of the rel attribute of a link in JavaScript?
- How to get the value of the target attribute of a link in JavaScript?
- How to get the value of the type attribute of a link in JavaScript?
- How to search the value of the target attribute of a link in JavaScript?
- How to search the value of the type attribute of a link in JavaScript?
- How to get the value of the id attribute a link in JavaScript?
- How to get an attribute value in jQuery?
Advertisements