相关疑难解决方法(0)

将输入更改为大写

JS:

<script type="text/css">
$(function() {
    $('#upper').keyup(function() {
        this.value = this.value.toUpperCase();
    });
});
</script>
Run Code Online (Sandbox Code Playgroud)

HTML

<div id="search">
        <input type="radio" name="table" class="table" value="professor" tabindex="1" /> Professor
        <input type="radio" name="table" class="table" value="department" tabindex="2" /> Department
        <input type="radio" name="table" id="upper" class="table" value="course" tabindex="3" /> Course
        <input type="text" name="search" class="keywords" value="Select an option..." onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?':this.value;" tabindex="4"  />
        <div id="content"> </div>
    </div>
Run Code Online (Sandbox Code Playgroud)

为什么这还不行?只是试图从JS调用div".keywords".

javascript jquery

63
推荐指数
6
解决办法
18万
查看次数

标签 统计

javascript ×1

jquery ×1