Notas de Luis

Javascript

Para cambiar de css ‘on the fly’:

  <head>
  <link id=mycss rel=stylesheet href='null.css' type='text/css'>
  <script type="text/javascript">
  function changeCSS(cssFile) {
      document.getElementById('mycss').href=cssFile;
  }
  </script>
  </head>
  <body>
  <a href="#" onclick="changeCSS('00.css');">00</a>
  <a href="#" onclick="changeCSS('01.css');">01</a>
  <a href="#" onclick="changeCSS('02.css');">02</a>
  <a href="#" onclick="changeCSS('03.css');">03</a>
  <a href="#" onclick="changeCSS('04.css');">04</a>
  <br>
  
  RESTO DE LA PAGINA
  </body></html>

Para abrir dos o más enlaces con un solo hipervínculo

  <a href="javascript:void(0);"
       onclick="javascript:window.open('http://www.google.es', '_blank'); window.open('http://www.google.es', '_blank'); ">
  Abrir varios enlaces
  </a>
computing/coding/javascript.txt · Última modificación: por 127.0.0.1