jessicacanuto

evento botão

Dec 9th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. $(document).ready(function(){
  2.  
  3. var combinacao;
  4.  
  5. function montaCombinacao(){
  6.  
  7. var selectA = $("#selectA").val();
  8. var selectB = $("#selectB").val();
  9.  
  10. console.log(SelectA);
  11. console.log(SelectB);
  12.  
  13. if(selectA === "Digital" && selectB === "1"){
  14. combinacao = "combinacao1";
  15. }
  16. else if(selectA === "Digital" && selectB === "2"){
  17. combinacao = "combinacao2";
  18. }
  19. else if(selectA === "Digital" && selectB === "3"){
  20. combinacao = "combinacao3"
  21. }
  22.  
  23.  
  24. }
  25. function montaBotao(){
  26. var location;
  27.  
  28. if (combinacao === "combinacao1"){
  29. location = "http://google.com.br";
  30. }
  31. else if (combinacao === "combinacao2"){
  32. location = "http://facebook.com";
  33. }
  34. else if (combinacao === "combinacao3"){
  35. location = "http://youtube.com.br";
  36. }
  37.  
  38. $("#download").onclick(window.location.href= location);
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45. });
Add Comment
Please, Sign In to add comment