Note that there are some explanatory texts on larger screens.

plurals
  1. POPlace one HTML input directly below another with HTML
    primarykey
    data
    text
    <p>So I have a bunch of HTML elements I'm creating dynamically. I would really like the element "imageBox" to appear directly below the "mediaBox" instead of to the left of it like it is now. Here is my code right now:</p> <pre><code>var div = document.createElement("div"); //HTML code for each element to be added with each new checkpoint var nameBox = "&lt;b&gt;Checkpoint " + markerId + ":&lt;/b&gt; &lt;input type='text' id=" + markerId + " placeholder='Checkpoint name'&gt;" var descBox = "&lt;textarea rows='4' cols='35' placeholder='Checkpoint description' id=" + markerId + "desc style='vertical-align: top;'&gt;&lt;/textarea&gt;" var mediaBox = "&lt;input type='text' id='media" + markerId + "' placeholder='paste URL to YouTube video' size='23'&gt;" var imageBox = "&lt;input type='text' id='image" + markerId + "' placeholder='paste URL to image' size='23'&gt;" var removeButton = "&lt;button type='button' value='Remove' id='remove" + markerId + "' onClick='remove_marker(" + markerId + ")'&gt; Remove &lt;/button&gt;" var undoButton = "&lt;button type='button' value='Undo' ' style='display: none;' id='undo" + markerId + "' onClick='remove_marker(" + markerId + ")'&gt; Undo &lt;/button&gt;" var removeText = "&lt;div id='removed" + markerId + "' style='display: none;'&gt; Removed &lt;button type='button' value='Undo' ' style='display: none;' id='undo" + markerId + "' onClick='undo_Remove(" + markerId + ")'&gt; Undo &lt;/button&gt; &lt;/div&gt;" div.innerHTML = nameBox + descBox + mediaBox + imageBox + removeButton + removeText; </code></pre> <p>I know it is really messy and ideally I should be using CSS but I'm not right now. It shows up on my page like this: <img src="https://i.stack.imgur.com/rPF5S.png" alt=""></p> <p>It would be great if the image URL box could be right under the YouTube one!</p> <p>Thanks so much!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload