I am appending check-boxes in a div by jQuery. Div is scroll when overflow. But I see that when checkbox names are large then div does not horizontally scroll but extra content goes to next line while vertical scroll works fine . below is some code
below is code of div creation
<div id="legendBox" style="overflow:scroll;width:145px;height:300px;"></div>
This code is to add check boxes in DIV
if (legendChecked == "T")
{
legendtest = "<input type='checkbox' class='" + legendClass + "' name='" + legendName + "' style='background-color:" + legendColor + "' value='" + legendName + "' checked onClick=legendChanged(); title='" + legendName + "' />" + legendName;
} else
{
legendtest = "<input type='checkbox' class='" + legendClass + "' name='" + legendName + "' style='background-color:" + legendColor + "' value='" + legendName + "' onClick=legendChanged(); title='" + legendName + "' />" + legendName;
}
$("#legendBox").append(legendtest+"</br>");
Please tell me where is mistake.