I want to add a hidden input after some element. I am using this code:
$("<in开发者_如何学运维put type="text">").insertAfter(".addProduct");
It doesn't work. But if I replace to it works.
$("<span>ddd</span>").insertAfter(".addProduct");
It works. Help me.
Thank you.
You should use single quotes:
$('<input type="text" />').insertAfter('.addProduct');
If you create this script in php, use this:
$("<input type=\"text\">").insertAfter(".addProduct");
精彩评论