As mentioned, jquery will be used to obtain all text controls in the page input control and add styles when the page is loaded.
The width attribute of the text control used on the page I wrote before is too small and needs to be changed. The change involves all the text attributes on the page. It feels very troublesome to change the width of each control, so I want to change it through the page. When loading, find the text to be changed and add attributes.
First I wrote a css style:
.wid
{
width:205px;
}
The code written in page loading is as follows:
$("input[type=text]").addClass("wid"); //Get all type=text controls in the input control and add styles to the text text box. This is complete.
javascript gets the page control and appends the style:
/ /Add a style to the select drop-down box
var g=document.getElementsByTagName("select"); //Set a variable to receive the found select control
for(i=0;i{
document.getElementById(g[i].id).style.width="210px"; //Additional style
}