1

Есть Iframe

<iframe src="" name="iframe1" id='iframe1'>
</iframe>

Как при помощи java script задать src айфрейму? Что-то типа:

function IFrame1() {
    document.getElementById('iframe1').contentWindow="1.html";
}

-

<div onClick="IFrame1()" class='Menu3'>
1 страница
</div>

2 ответа 2

2
function IFrame1() {
    document.getElementById('iframe1').src="http://hashcode.ru";
}
-1
function IFrame1() {
    document.getElementById('iframe1').setAttribute('src', '1.html');
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.