2009-11-06 26 views

回答

2
// grab the div and the first iframe inside it: 

var iframe = document.getElementById('xyz').getElementsByTagName('iframe')[0]; 

// There are two different valid ways to set the height 

// 1. Change the attribute like it was <iframe height="70" ... /> 
iframe.height = '70'; 

// 2. Change the attribute like it was <iframe style="height: 70px;" ... /> 
iframe.style.height = '70px'; 
相關問題