js如何判断方法参数是对象还是其他的

  <input id="mc" type="text" value="a"/>
<input name="mc" type="text" value="b"/>
<input type="button" onclick="a("+mc+")" value="c">
<script type="text/javascript">
function a(mc){

}
    </script>

js方法怎么知道是id为mc的控件对象传入还是name为mc的控件对象传入

     function a(mc){
        alert(typeof mc)//如果是对象输出object,要不就是基本类型string,number等
    }

typeof 判断,应该是,这个好久没用了

你这样写,啥都不是吧。 这样传参好像就不对

typeof 判断,应该是,这个好久没用了