1
我希望當點擊電話代碼文本顯示它的第二提示跨度HINT2當點擊電話號碼的文本顯示其第一個暗示跨度是可能的只有JavaScript做????替換的onclick
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Javascript Change Div InnerHTM</title>
<link type="text/css" rel="stylesheet" href="pasha_css/hint.css"></link>
<script type="text/javascript" src="pasha_js/hint.js"></script>
<link href="pasha_css/main.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="form-item7" class="form-profile">
<label class="form-phone">Phone:</label>
<input type="text" name="Phone_code" value="03" class="form-text phonecode " onclick="this.value=''" onselect="this.value=''"></input>
<input type="text" name="phone" value="4567890"
class="form-text phone" onclick="this.value='';" onselect="this.value=''"></input>
<span id="hint1" class="hint">Use Text only please!
<span class="hint-pointer"> </span>
</span>
<span id="hint2" class="hint">enter code!
<span class="hint-pointer"> </span>
</span>
</div>
</body>
</html>
使用jQuery,只有它的JavaScript。 :P – 2011-06-12 09:45:32