Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html><head><title>Bla bla</title>
- <script type='text/javascript' src='jquery-1.9.1.min.js'></script>
- <script type='text/javascript'>
- $(document).ready(function() {
- var clickCount = 0;
- $('#hyperlink').on('click', function(e) {
- e.preventDefault();
- $('#hyperlink').hide();
- $('#listbox').show();
- });
- $('#listbox').on('click', function() {
- clickCount++;
- if(clickCount<2) return;
- $('#href').attr('href', $('#blabla option:selected').val());
- $('#href').text($('#blabla option:selected').text());
- $('#listbox').hide();
- $('#hyperlink').show();
- clickCount = 0;
- });
- $('#letsgo').on('click', function() {
- window.location.replace( $('#href').attr('href') );
- });
- });
- </script></head>
- <body><br><br><br><br><br><br>
- <div align=center>
- <span id='hyperlink'><a id='href' href='http://www.kaskus.co.id'>KusKas</a></span>
- <span id='listbox' style='display:none;'>
- <select id='blabla'>
- <option value='http://www.kaskus.co.id'>KusKas</option>
- <option value='http://www.yahoo.com'>Yahuu</option>
- <option value='http://www.google.com'>Gugel</option>
- <option value='http://www.whitehouse.gov'>Gedung Putih</option>
- <option value='http://www.laporpresiden.id'>Lapor Jokowi</option>
- </select></span>
- <button id='letsgo'>go</button>
- </div></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement