Solution Review: Get Elements Using Attributes
Explore how to implement the getElementByAttribute function to select DOM elements by attribute and element type. Understand how to convert user input text to uppercase dynamically using JavaScript by applying this approach to an input field. This lesson helps you grasp attribute-based element selection and real-time text transformation in the browser.
We'll cover the following...
Solution
Explanation
In this challenge, you had to implement the functions getElementByAttribute, which takes two parameters: the attribute name and the element_type. You had to use this function to implement the function lowerupper that converts all alphabets entered in the First name input text field to the upper case.
In the HTML file, we have defined two input elements for first name and last name with the following attributes:
-
...