Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. <select id="surah_selection" style="position:relative; top:10px; left:25px">
  2. <option id="1">Select Surah</option>
  3. <option id="2" >Al-Baqra</option>
  4. <option id="3">Al-Fatiha</option>
  5. <option id="4">Al-noor</option>
  6. <option id="5">Al-Tobah</option>
  7. </select> <!--Surah selection ends -->
  8.  
  9. $('#book_selection').change(function(){
  10. alert("changed");
  11. var option = document.createElement("option");
  12. option.text = 'df';
  13. option.value = 'df';
  14. var temp = document.createElement('select');
  15. temp.appendChild(option);
  16. var root = document.getElementById('book_selection');
  17. root.appendChild(temp);
  18. alert("done");
  19. });
  20.  
  21. $('#book_selection').change(function(){
  22. var newSelect=document.createElement('select');
  23. var selectHTML="";
  24. for(i=0; i<choices.length; i=i+1){
  25. selectHTML+= "<option value='"+choices[i]+"'>"+choices[i]+"</option>";
  26. }
  27.  
  28. newSelect.innerHTML= selectHTML;
  29. document.getElementById('book_selection').appendChild(newSelect);
  30. });
  31.  
  32. $('#book_selection').change(function() {
  33. $("<select />").append($("<option>", {"value": "me", "text": "me"})).insertAfter($(this));
  34. });
  35.  
  36. <select id="surah_selection" style="position:relative; top:10px; left:25px">
  37. <option id="1">Select Surah</option>
  38. <option id="2" >Al-Baqra</option>
  39. <option id="3">Al-Fatiha</option>
  40. <option id="4">Al-noor</option>
  41. </select>
  42.  
  43. <script>
  44. function add(){
  45. var str="<option id='5'>Al-Tobah</option>"
  46. $("#surah_selection").append(str);
  47. }
  48. </script>
  49.  
  50. <div class="surah_selection></div>
  51.  
  52. var selectSurah = '<select id="surah_selection" style="position:relative; top:10px; left:25px"><option id="1">Select Surah</option><option id="2" >Al-Baqra</option><option id="3">Al-Fatiha</option><option id="4">Al-noor</option><option id="5">Al-Tobah</option></select>';
  53. $(".surah_selection").prepend(selectSurah);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement