<script language="javascript">
<!--
function all_longs()
{
document.form1.start_time.readOnly = true;
document.form1.start_time.style.backgroundColor= "#C0C0C0";
document.form1.end_time.readOnly = true;
document.form1.end_time.style.backgroundColor= "#C0C0C0";
}
function no_all_longs()
{
document.form1.start_time.readOnly = false;
document.form1.start_time.style.backgroundColor= "#FFFFFF";
document.form1.end_time.readOnly = false;
document.form1.end_time.style.backgroundColor= "#FFFFFF";
}
//-->
</script>
<!--
function all_longs()
{
document.form1.start_time.readOnly = true;
document.form1.start_time.style.backgroundColor= "#C0C0C0";
document.form1.end_time.readOnly = true;
document.form1.end_time.style.backgroundColor= "#C0C0C0";
}
function no_all_longs()
{
document.form1.start_time.readOnly = false;
document.form1.start_time.style.backgroundColor= "#FFFFFF";
document.form1.end_time.readOnly = false;
document.form1.end_time.style.backgroundColor= "#FFFFFF";
}
//-->
</script>
多谢,很受启发!请问可否修改text 的边框 border 呢?
SyntaxHTML { border-width : sWidth }
Scripting object.style.borderWidth [ = sWidth ] Possible ValuessWidth String that specifies or receives up to four of the following values:
medium Default.
thin Width less than the default.
thick Width greater than the default.
width Width consisting of a floating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex).
function chanagecss()
{
document.form1.textname.style.borderWidth='1cm'//改成1cm
.....其它的可以看看一楼的
}
</script>建议楼主最看装个msdn那里面很多东东都可以查到
.css1 {border:1px solid}
.css2 {border:0px}
</style>
<input type="text" name="txt" class="css2" onclick="this.className=this.className=='css2'?'css1':'css2'" value="baobao"
onblur="this.className=this.className=='css2'?'css1':'css2'" value="baobao">