javascript - Formatting search results displayed in a div -


i advice on formatting div tags.

currently div tag in codes display results performed in function:

document.getelementbyid("searchresults").innerhtml = searchhtml; 

and searchresults displayed in div.

<div id="searchresults"></div> 

currently outputs displayed stacked horizontally.

it looks kind messy difficult differentiate each output.

i know there way format each of output. example each of outputs in container of own?

and can each of container can personalized more?

for each result following:

// create div var resultdiv = document.createelement('div'); resultdiv.innerhtml = result; resultdiv.classname = "resultcontainer"; // add appropriate css  // append result container document.getelementbyid('searchresults').appendchild(resultdiv); 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -