עבור לתוכן

צריך עזרה אם javascrip

Featured Replies

פורסם

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[url]http://www.w3.org/TR/html4/loose.dtd">[/url]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>Insert title here</title>
</head>
<script type='text/javascript'> function chang(i){
var a=document.getElementById('test');
var b=document.getElementById('bg');
var c=document.getElementById('box'); if(i==1){
a.color="red";
}
if(i==2)
{
a.size=" 4";
}
if(i==3){
a.face="courier, bookman";
}
if(i==4){
b.bgColor = 'blue' ;
}
if(i==5){
a.style='underline';
}
if(i==6)
{
c.border="2";
}
}
</script>
<body>
<center>
<table bordercolor="green" id="box" >
<tr id="bg"><td>
<font id="test">My styled text</font>
</td></tr>
</table>
<br></br>
<font onmouseover='chang(1)'>chang color</font>
<br></br>
<font onmouseover='chang(2)'>chang size</font>
<br></br>
<font onmouseover='chang(3)'>chang font</font>
<br></br>
<font onmouseover='chang(4)'>chang bgcolor</font>
<br></br>
<font onmouseover='chang(5)'>add under line</font>
<br></br>
<font onmouseover='chang(6)'>add border</font>
</center>
</body>
</html>

אני לא מצליח לעשות את 5 הוספה של underline :bash:

ולא מוצא דוגמא לזה ב google :(:s07:

פורסם

תשנה את הקוד ל:

a.style['text-decoration']='underline';

פורסם
  • מחבר

ניסיתי לא עבד ???

פורסם
  • מחבר

טוב אז במה כדי להשתמש

span?

פורסם

a.style="text-decoration; underline; ";

תשתמש בספאן

פורסם
  • מחבר

טובב שינתי ל span

אבל זה עדין לא עובד

:(

נמצא פתרון :)

 
a.style.textDecoration='underline';

:yelclap: :yelclap: :yelclap: :yelclap: :yelclap:

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים