jquery get tag type

Getting the element type the jQuery way:
var elementType = $(this).prev().prop('tagName');
Checking for specific element type:

var is_element_input = $(this).is("input"); //true or false
then you can do this:
if ($('#myiframe').is('iframe'))
  $("#myiframe").contents().find("#myContent")

评论

热门博文