Cara Buat Drop Down Messages Di Blog

Cara Buat Drop Down Messages Di Blog

>>> pada dasbor>>> Rancangan>>> Elemen Laman>>> Tambah Gadget>>> HTML/JavaScript

Contoh Demo





Copy semua code di bawah ini dengan menekan CTRL C


<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr> <td width="100%"><form name="ddmessage">
<table border="0" cellpadding="0" cellspacing="0"><tbody>
<tr> <td width="100%"><select name="selectbox" onchange="changecontent(this)" size="1"> <option selected="selected" value="Judul tulisan 1">Judul tulisan 1</option> <option value="Judul tulisan 2">Judul tulisan 2</option> <option value="Judul tulisan 3">Judul tulisan 3</option> </select>

</td> </tr>
<tr> <td width="100%"><textarea cols="35" name="contentbox" rows="8" wrap="virtual"></textarea>

<script type="text/javascript">
document.write(unescape('%3C%73%70%61%6E%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%20%61%72%69%61%6C%3B%22%3E%4B%61%6D%75%20%6D%61%75%20%70%61%73%61%6E%67%20%77%69%64%67%65%74%20%73%65%70%65%72%74%69%20%69%6E%69%2C%3C%61%20%68%72%65%66%3D%22%68%74%74%70%3A%2F%2F%6A%6F%65%73%65%74%61%70%61%72%74%2E%62%6C%6F%67%73%70%6F%74%2E%63%6F%6D%2F%32%30%31%31%2F%30%36%2F%64%72%6F%70%2D%64%6F%77%6E%2D%6D%65%73%73%61%67%65%73%2E%68%74%6D%6C%22%20%74%61%72%67%65%74%3D%22%5F%62%6C%61%6E%6B%22%3E%43%6C%69%63%6B%20%44%69%73%69%6E%69%3C%2F%61%3E%3C%2F%73%70%61%6E%3E'));
</script></td> </tr>
</tbody></table>
</form>
</td> </tr>
</tbody></table>

<script language="JavaScript">

//change contents of message box, where the first one corresponds with the first drop down box, second with second box etc
var thecontents=new Array()

thecontents[1]='Isi dari tulisan 1'

thecontents[2]='Isi dari tulisan 2'

thecontents[3]='Isi dari tulisan 3'

//don't edit pass this line

function changecontent(which){
document.ddmessage.contentbox.value=thecontents[which.selectedIndex]
}

document.ddmessage.contentbox.value=thecontents[document.ddmessage.selectbox.selectedIndex]
</script>
Sumber : http://joesetapart.blogspot.com/









Contact Us

Name

Email *

Message *

Back To Top