Jquery insert div right inside the form

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 this?

<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
source share
1 answer
$('#formID').prepend('<div>DIV CONTENT</div>');
+5
source

Source: https://habr.com/ru/post/1732682/


All Articles