HTML DOM properti Gambar tinggi
Definisi dan Penggunaan
tinggi set properti atau mengembalikan nilai properti dari tinggi gambar.
Atribut tinggi menentukan tinggi gambar.
tatabahasa
imageObject.height=pixels
Dukungan Browser
Semua browser utama mendukung atribut tinggi
contoh
contoh
Contoh berikut mengatur tinggi gambar dan lebar:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi changeSize () {
document.getElementById ( "compman") height = "250" .;
document.getElementById ( "compman") width = "300" .;
}
</ Script>
</ Kepala>
<Body>
<Img id = "compman" src = "compman.gif" width = "107" height = "98">
<br>
<Input type = "button" onclick = "changeSize ()" value = "mengubah ukuran gambar">
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Script>
Fungsi changeSize () {
document.getElementById ( "compman") height = "250" .;
document.getElementById ( "compman") width = "300" .;
}
</ Script>
</ Kepala>
<Body>
<Img id = "compman" src = "compman.gif" width = "107" height = "98">
<br>
<Input type = "button" onclick = "changeSize ()" value = "mengubah ukuran gambar">
</ Body>
</ Html>
Coba »
gambar Object