The text must have matching case to be selected. The .text() method cannot be used on form inputs or scripts. HTML Links - The target Attribute. The method adds the class attribute to the HTML element as well the styling of the specified class. This event is limited to elements,