Change your function as shown below
function newField()
{
document.getElementById('container').innerHTML = '<div id="myFile" style="width:100px;overflow:hidden;border:thin solid" title=\'' + document.getElementById('myFile').innerHTML+ '\'>thisisaverylongfilename.jpg</div>';
}
You may use document.getElementById('myFile').innerText
Reputation Points: 245
Solved Threads: 259
Nearly a Posting Virtuoso
Offline 1,250 posts
since Dec 2008