When creating an input field in my code, I followed these steps:
var inputVal = document.createElement("input");
inputVal.setAttribute("type", "checkbox");
inputChek.onchange = select;
inputChek.setAttribute("value", title);
//inputChek.after(sortDiv);
docClass.prepend(inputChek);
docClass.append(newDiv);
However, I encountered an issue where the div with the arrow image was not appearing as expected. The div was being created, but it appeared below the text instead of alongside it.
To address this issue, I added a new div as follows:
var newDiv = document.createElement("div");
newDiv.setAttribute("class", "Arrow");
newDiv.setAttribute("onclick",'divClick("title")');
newDiv.style.background = "red";
newDiv.style.width = "10px";
newDiv.style.height = "10px";
After adding the new div, I expected the following image to be displayed next to the text: https://i.sstatic.net/wYazj.png Does anyone have a solution for this display issue?