I need to set the text within a DIV element dynamically. What is the best, browser safe approach? I have prototypejs and scriptaculous available.
<div id='panel'> <div id='field_name'>TEXT GOES HERE</div> </div>
Here’s what the function will look like:
function showPanel(fieldName) { var fieldNameElement = document.getElementById('field_name'); //Make replacement here }
I would use Prototype’s
updatemethod which supports plain text, an HTML snippet or any JavaScript object that defines atoStringmethod.