Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="es">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>3.5.1</title>
- </head>
- <body>
- <script type="application/javascript">
- const configVentanaSelColor = "width=620,height=330,top=100,left=500";
- function selectorColor() {
- function cambiarCol() {
- let eleccion = document.getElementById("listaColores").value;
- console.log(eleccion);
- }
- let vSelColor = window.open("","Selector de Color",configVentanaSelColor);
- // debugger;
- // vSelColor.document.write("<script type='application/javascript'>");
- // vSelColor.document.write("console.log('TEST')");
- // vSelColor.document.write("< /script>");
- // vSelColor.document.write("<body>");
- // let scriptVentanaHija = "<script type='application/javascript'>" +
- // "() => {alert('test')}";
- vSelColor.document.write("<h1>Selecciona un color para el texto:</h1>");
- vSelColor.document.write("<form id='form'>");
- vSelColor.document.write("<select id='listaColores'>");
- vSelColor.document.write("<option selected value='Rojo'>Rojo</option>");
- vSelColor.document.write("<option value='Azul'>Azul</option>");
- vSelColor.document.write("<option value='Amarillo'>Amarillo</option>");
- vSelColor.document.write("<option value='Verde'>Verde</option>");
- vSelColor.document.write("</select> ");
- vSelColor.document.write("</form>");
- vSelColor.document.write("<script type='application/javascript'>");
- vSelColor.document.write("function test() {window.opener.document.write(6)}");
- let finscript = "</script>";
- vSelColor.document.write(encodeURIComponent(finscript));
- vSelColor.document.write("<button onclick='test()'>Modificar Color</button>");
- // vSelColor.document.write("</body>")
- }
- </script>
- <input id= "nomColor" type="text"> <br><br>
- <button name="ModifColor" onclick="selectorColor()" >Mostrar opciones de color</button>
- <!-- <input type='button' onclick='window.opener.document.write(3)'> -->
- </body>
- </html>
- <!-- form.color.options[color.selectedIndex].text\'> -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement