tags:

views:

159

answers:

1

If i have the code below and i want to insert a div with jquery as the first element inside the form tag what is the best way to do that?

<form>
    //i want to insert a div here with jquery
    <label>...</label>
    <input>...</input>
    <img>...</img>

    <label>...</label>
    <input>...</input>
    <img>...</img>

    <label>...</label>
    <input>...</input>
    <img>...</img>
</form>
+3  A: 
$('#formID').prepend('<div>DIV CONTENT</div>');
Fermin
Works great. I guess after reading the documentation for prepend i thought it would have inserted it before the form tag. Thanks
Catfish