3-amaliy ish Mavzu: JavaScript funksiyalar va obyektlari. JavaScriptda doimiy ifodalar. Ishdan maqsad


Download 124.5 Kb.
bet2/3
Sana20.01.2023
Hajmi124.5 Kb.
#1104540
1   2   3
Bog'liq
3-amaliy ish








home.gif name=“pic1” width = 200 height = 100>


Name:

e – mail:






http://maks/index.html”>


< form name = “myForm >
< input type = “text” name = “myText” value = “xa xa xa” >
< input type = “button” name=“button1” value = “button1” >
onclick = “first ()”
< input type = “checkbox” name = “mycheckbox”>
< input type = “button” name=“button 2” value = “button2” >
onclick = “second()”
< /form >
< p > < br > < br >
< script language = “ JavaScript ”>
document.write( “Fon ranggi bu : ”) ;
document.write( document.bgcolor+ “
”) ;
document.write( “ 2 chi button dagi matn :”) ;
document.write( “ document.myForm.button 2.value”) ;
// --
< /script >
< /body >

Location obyekti
JavaScript da window va document obyektlaridan tashqari location deb ataluvchi yana bir muhim obyekt mavjud. Bu obyektda HTML dokument Yo’qlangan adres saqlanadi. Agar siz http://www.xyz.com/page/html Sahifasini Yo’qlagan bo’lsangiz, u xolda location.href ning qiymati ham xuddi shu adresga mos tushadi. Shunday bo’lsada biz uchun juda muhim narsa shuki, siz location.href ga yangi qiymat yozishingiz mumkin. Masalan, quyidagi misolda tugmacha joriy darchadan yangi Sahifaga o’tishni Yo’qlaydi :
< form >
< input type = button value=“Yahoo”>
onclick = “location.href = ` http://www.Yahoo.com ` ; ”
< /form >
Amali ishning topshiriqlari:

Download 124.5 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling