零散记录

2016-11-01  本文已影响5人  im宇

HTML

来自百度.jpg
onclick="window.location.reload()"
autocomplete="new-password"

jQuery

JqueryObject.val("setter");//setter方法
var value = JqueryObject.val();//getter方法
//html部分
<input class="hh" type="radio" name="nn">hello</input>
<input type="radio" name="nn">world</input>
//js部分
$(".hh")[0].checked = true;
//$(".hh").checked = true;  不起作用
alert($(".hh")[0].checked);
//alert($(".hh")[0].checked);   不起作用
$(document).on("click",".class-name",function(e){
 //do something
});
// 使能标签的hover效果,新增加标签都需要调用该方法
function resumeHover(){
    //当鼠标移动到一个匹配的元素上面时,会触发指定的第一个函数。
    //当鼠标移出这个元素时,会触发指定的第二个函数。
    $(".class-name").hover(function() {
        //do something
    },function() {
        //do no hovered something
    })
}
//监听鼠标的over、out事件
$(document).on("mouseover mouseout",".classname",function(e){
    if(e.type == "mouseover"){
        //do something
    }else{
        //do something
    }
})
$(window).resize(function(){
    alert($(this).height());
});

JavaScript

String.fromCharCode(i+65);  //得到A

Thymeleaf

<script th:inline="javascript">
    /*<![CDATA[*/
    var user = /*[[${user}]]*/'';
    /*]]>*/
</script>
上一篇 下一篇

猜你喜欢

热点阅读