I need to create an iframe for each input on a page, but all of them must be in different variables. So, the iframes' vars must be the inputs' names.
I tried this, but it didn't work:
$("input").each(function () {
var name = $(this).attr("name");
name = document.createElement("iframe");name.src = "";name.name = "focus";document.body.appendChild(name);
});
This is my original working iframe create code:
var focus = document.createElement("iframe");focus.src = "";focus.style.display = "none";focus.name = "focus";document.body.appendChild(focus);
I took the input name with attr(). I want to create an iframe according to that input name. after that for example I will be able to redirect it by INPUTNAME.src
How can I create specific iframes according to input names?