问题描述:

I want to add a hidden input after some element.

I am using this code:

$("<input 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");
相关阅读:
Top