Curtis Crewe Curtis Crewe - 2 years ago 204
CSS Question

Add inline style using Javascript

I'm attempting to add this code to a dynamically created div element

style = "width:330px;float:left;"

The code in which creates the dynamic

var nFilter = document.createElement('div');
nFilter.className = 'well';
nFilter.innerHTML = '<label>' + sSearchStr + '</label>';

My idea is to add the style after
< div class="well"
but i don't know how i'd do it.

Answer Source'330px';'left';

This should add an inline style to the element.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download