怎么在JS中传递this参数的?
<script LANGUAGE= "JavaScript ">
<!--
function chooseDate() {
setday(this);
-->
</script>
这个this怎么才能传过去的啊?
------解决方案-------------------- <script LANGUAGE= "JavaScript ">
<!--
function chooseDate() {
setday(this);
}
-->
</script>
这样已经把this传到setday里了啊。
------解决方案-------------------- <script LANGUAGE= "JavaScript ">
<!--
function chooseDate(this) {
setday(this);
}
-->
</script>
------解决方案-------------------- <input name= "date " onfocus=chooseDate(this) readOnly/>
<script LANGUAGE= "JavaScript ">
<!--
function chooseDate(obj) {
setday(obj);
}
-->
</script>
------解决方案-------------------- <input name= "date " onclick= "chooseDate() "/>
<script LANGUAGE= "JavaScript ">
<!--
function chooseDate() {
var e = window.event || chooseDate.caller.arguments[0];
setday(e.srcElement || e.target);
}
function setday(o) {
alert(o.name);
}
-->
</script>
------解决方案-------------------- <input name= "date " onfocus=chooseDate(this) readOnly/>
function chooseDate(obj) {
setday(obj);
}