ptg16476052
Modifying Content on the Page 513
18
Manipulating Attributes Directly
You can also use jQuery to manipulate the attributes of elements directly. For example,
disabling a form field entirely requires you to modify the disabled attribute of that field.
I’ve added a Submit button to the form from the previous example and set it to disabled.
Here’s the new form:
Figure 18.10 shows the form with the sample content and the disabled Submit button.
FIGURE 18.9
The contents of
the email field are
removed when the
user clicks in it.
FIGURE 18.10
This form contains
sample content,
and the Submit
button is disabled.