Posts

Showing posts from August, 2016

Soal-soal Ujian Masuk Programmer Perusahaan 2015(Part 2)

Image
Ini adalah sambungan dari ujian part 1. Jangan Lupa Lihat Perkenalan Algorithma Javascript Set Index in javascript The selected Index property sets or returns the index of the selected option in a drop-down list. var x = document.getElementById("mySelect").selectedIndex; var y = document.getElementById("mySelect").options; alert("Index: " + y[x].index + " is " + y[x].text); Refference: prop_select_selectedindex.asp js Regular expression Untuk Js Regular expression karena terlalu banyak anda bisa melihat sendiri di link di bawah. function to get cookieRefference: jsref_obj_regexp.asp Set cookies in javascript function to set cookie function setCookie(cname, cvalue, exdays) {     var d = new Date();     d.setTime(d.getTime() + (exdays*24*60*60*1000));     var expires = "expires="+d.toUTCString();     document.cookie = cname + "=" + cvalue + "; " + expires; } function