html鍵盤
1. html 中的 input,怎樣觸發 iOS 中不同類型的鍵盤
大概有以下這幾種:
<input type="email" name="email"> 郵件鍵盤
<input type="url" name="url"> URL鍵盤
<input type="tel" name="tel"> 電話號碼鍵盤
<input type="number" name="number"> 數字鍵盤
<input type="date" name="date"> 日期鍵盤
<input type="time" name="time">時間鍵盤
<input type="datetime" name="datetime"> 日期和時間一起專
<input type="month" name="month"> 月份鍵盤
註:在桌面瀏屬覽器中,能支持日期/時間的input類型的瀏覽器仍非常有限。Opera瀏覽器目前有著最好的實現,支持本篇文章中所有提到的類型。谷歌的Chrome瀏覽器支持 date 類型,但現在沒有其他東西。Safari瀏覽器有日期格式的文本欄位,但不支持像Opera和Chrome上顯示的那樣的日歷小組件。
2. html中將鍵盤和按鈕關聯
||
<buttonid="plus"></button>
<script>
varplus=document.getElementById("plus");
plus.onkeyDown=function(e){
vare=e||window.event;
alert(e.keyCode)//根據鍵值的不同來實現鍵盤專輸屬入
}
</script>
3. html標記<鍵盤怎麼打出來
需要轉義
<
4. html網頁中,一個鍵盤,一個textbox,點鍵盤上的數字,顯示在textb中,代碼怎麼寫
<script>
function SetValue(btn){
var txt=document.GetElementById('textb');
txt.value=btn.value;
}
</script>
<button value="1" onclick="SetValue(this)"/>
5. HTML問題!如何做一個類似於軟鍵盤輸入密碼的代碼,輸入不用鍵盤,用按鈕!!
哇,好晚了,終於搞定了,我把代碼貼下面:
頁面1:
<html>
<head>
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function btnEnter_onclick() {
window.location.href = "Result.htm?" + txtNum.value;
}
function btnNum_onclick(i) {
txtNum.value=txtNum.value+i
}
</script>
</head>
<body>
<p style="height: 60px">
<input id="Button1" type="button" value="1" onclick="return btnNum_onclick(1)" />
<input id="Button2" type="button" value="2" onclick="return btnNum_onclick(2)"/>
<input id="Button3" type="button" value="3" onclick="return btnNum_onclick(3)"/>
<input id="Button4" type="button" value="4" onclick="return btnNum_onclick(4)"/>
<input id="Button5" type="button" value="5" onclick="return btnNum_onclick(5)"/>
<input id="Button6" type="button" value="6" onclick="return btnNum_onclick(6)"/>
<input id="Button7" type="button" value="7" onclick="return btnNum_onclick(7)"/>
<input id="Button8" type="button" value="8" onclick="return btnNum_onclick(8)"/>
<input id="Button9" type="button" value="9" onclick="return btnNum_onclick(9)"/>
<input id="Button0" type="button" value="0" onclick="return btnNum_onclick(0)" />
<br /><br />
<input id="txtNum" type="password" />
<input id="btnEnter" type="button" value="Enter" onclick="return btnEnter_onclick()" />
</p>
</body>
</html>
頁面2:
<html>
<head>
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
function inputnum() {
var url = location.search
if (url.indexOf("?") != -1) {
var str = url.substr(1)
input1.value = str
}
}
</script>
</head>
<body onload="return inputnum()">
<input id="input1" type="text" />
</body>
</html>
滿意就給分吧,有不理解的跟我說,呵呵
6. html. text文本框限制鍵盤輸入法
限制鍵盤不能輸入嗎?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<script>
// 樣式 style="ime-mode:disabled" 禁止中文輸入
function noPermitInput(e){
var evt = window.event || e ;
if(isIE()){
evt.returnValue=false; //ie 禁止鍵盤輸入
}else{
evt.preventDefault(); //fire fox 禁止鍵盤輸入
}
}
function isIE() {
if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 1)
return true;
else
return false;
}
</script>
</head>
<body>
禁止鍵盤按鍵輸入及中文輸入
<input type="text" value="" style="ime-mode:disabled" onkeypress="noPermitInput(event)" >
</body>
</html>
7. html解決軟鍵盤問題
在軟鍵盤彈出時,讓body postion:fixed就可解決軟鍵盤彈出不被擠壓的問題
請點贊
8. HTML鍵盤屬性的使用方法是怎樣的
這些代碼基本上用不到,如果你只寫html的話。
accesskey就是設置一個元素的快捷鍵
tabindex就是你按tab鍵時,往下走的順序
9. 求一個關於鍵盤上按鍵的一個html代碼
不少網友的主頁上都放置了背景音樂,這給網頁增色不少,但有時候訪客並不喜歡這樣,因為,他在打開你的網頁之前可能正在聽別的音樂,或者是別的原因。這個時候應該給來客一個選擇的機會:停止或暫停背景音樂的播放。
如果你的背景音樂是用<embed>方法播放的,那麼控制起來非常容易的。Follow me!
首先我們需要給出<embed>一個id,這個id就是背景音樂的標識,在你的網頁代碼中它必須是唯一的,也就是,其他元素如果也用了id的話,就不能和它重復,否則會出亂。這有點像有兩個黑馬在一塊,你一叫,兩個都有響應,結果就亂了。記住,id要唯一。
下面是定義了id的<embed>語句樣式:
<embed src="音樂文件地址" type=audio/mpeg hidden="true" autostart="true" loop="true" id="music"></embed>
上面代碼中,我們用"music"來做為背景音樂播放機的標識,往下我們就通過對這個標識進行控制,從而達到控制背景音樂的目的。
一般地,用於網頁播放的插件都有對音樂的幾個基本的控制方法:play(播放)、stop(停止)和pause(暫停)。它們的語法約定是:標識.方法(),例如播放音樂的語句是:music.play()。這樣,我們可以設置幾個按鈕,當按鈕被點擊時發出相應的指令。以下就是實現代碼:
<form>
<input type="button" value="播放" onclick="music.play()">
<input type="button" value="停止" onclick="music.stop()">
<input type="button" value="暫停" onclick="music.pause()">
</form>
幾點說明:
一、關於embed
◇ embed可用的媒體格式比較豐富,可放心使用。但如果該媒體格式所使用的插件不提供play、stop等方法(極少有),那我們的設置是無效的;
◇ type應當指定。但是,盡管指定,它仍然依賴於訪客機器中對媒體文件的關聯設置,比如,訪客將MP3和RealPlay做了關聯,那麼,他的機器就會用RealPlay在後台播放背景音樂;
◇ 使用hidden="true"來隱藏播放機比用width=0 height=0效果要理想得多,用後者並不能完全隱藏,不是有一條線就是有一個點出現在網頁里。
二、關於input
◇ type="button":不能改動,button是「按鈕」的意思;
◇ value="播放":按鈕上面的說明文字;
◇ onclick:表示滑鼠左鍵單擊操作,後面用「=方法」向系統發出指令。
以下是實例代碼與效果:
<embed src=http://www.gxblk.com/music/test.mid type=audio/mpeg hidden="true" autostart="true" loop="true" id="music"></embed>
<form>
<input type="button" value="播放" onclick="music.play()">
<input type="button" value="停止" onclick="music.stop()">
<input type="button" value="暫停" onclick="music.pause()">
</form>
附:bgsond的控制方法
<bgsound src="音樂地址" id="music" loop=-1>
<a href="#" onclick="music.src=''">停止</a>
<a href="#" onclick="music.src='音樂地址'">播放</a>
10. html頁面中如何讓鍵盤不沖突
用JS控制,可以判斷鍵盤同時按下哪兩個鍵。單純HTML是不能判斷的~