Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HTML文本输入选择焦点上的所有内容不在chrome中工作_Javascript_Jquery_Html_Focus - Fatal编程技术网

Javascript HTML文本输入选择焦点上的所有内容不在chrome中工作

Javascript HTML文本输入选择焦点上的所有内容不在chrome中工作,javascript,jquery,html,focus,Javascript,Jquery,Html,Focus,我在一个表格单元格中有一组文本输入,如下所示: <td class="tdTextInput"> <input type="text" value="0" name="txt1_9_4_2" id="txt1_9_4_2" class="input-supermini"> </td> CommonTools.IsNumeric指的是以下内容:-(可能不相关,因为按键功能不是问题所在。仅在问题中添加它以确保完整性) isNumeric=函数(e) {

我在一个表格单元格中有一组文本输入,如下所示:

<td class="tdTextInput">
    <input type="text" value="0" name="txt1_9_4_2" id="txt1_9_4_2" class="input-supermini">
</td>
CommonTools.IsNumeric
指的是以下内容:-(可能不相关,因为按键功能不是问题所在。仅在问题中添加它以确保完整性)

isNumeric=函数(e)
{
如果(!(e.which>=48&&e.which参考:

这也可能有帮助:

当页面加载时,让“名字”输入字段自动获得焦点:

<form action="demo_form.asp">
  First name:<input type="text" name="fname" autofocus><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit">
</form> 

名字:
姓氏:

Ineed,你必须像@Muhammad说的那样使用鼠标。举个例子:
isNumeric = function (e)
{
    if(!(e.which>=48 && e.which<=57)) //numeric values only
            e.preventDefault();
}
$(".tdTextInput input").mouseup(function(e){
    e.preventDefault();
});
$(".tdTextInput input").live('mouseup', function () {
        $(this).select();
});
<form action="demo_form.asp">
  First name:<input type="text" name="fname" autofocus><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit">
</form>