I want to do the following:(我要执行以下操作:)
<div id="theDiv" style="width: aJavascriptVariableOrFunctionCallToGetValue">TESING</div>
I don't want to use, elsewhere in the code,(我不想在代码的其他地方使用)
document.getElementById('theDiv').style.width = someValue;
I actually want that div, when it first appears , to have a width set, inline, by either a JavaScript variable or by way of a call to a JavaScript function.(实际上,我实际上希望该div 在首次出现时通过JavaScript变量或通过调用JavaScript函数的方式内联设置宽度。)
How can I do this?(我怎样才能做到这一点?)
ask by CFHcoder translate from so