| |||
|
<html> <head> <script type="text/javascript">
function LimparSaida ()
{ Paragrafo.innerHTML= ''; }
function EnviarSaida (Linha)
{ Paragrafo.innerHTML+= Linha + '<br>'; }
function Listar (Objeto)
{ LimparSaida (); EnviarSaida ('Id: ' + Objeto.id); EnviarSaida ('Style.Color: ' + Objeto.style.color); EnviarSaida ('Style.BackgroundColor: ' + Objeto.style.backgroundColor); EnviarSaida ('Style.FontFamily: ' + Objeto.style.fontFamily); EnviarSaida ('Style.FontSize: ' + Objeto.style.fontSize); EnviarSaida ('Style.FontWeight: ' + Objeto.style.fontWeight); EnviarSaida ('Style.TextAlign: ' + Objeto.style.textAlign); EnviarSaida ('Style.TextDecoration: ' + Objeto.style.textDecoration); }
function Atribuir (Objeto)
</script>{ var Estilo, Indice; Indice = Selecao.selectedIndex; Estilo = Selecao.options.item (Indice).innerHTML; Objeto.style.cssText= Estilo; Listar (Objeto); } </head> <body onload="Listar (Paragrafo)"> <p id="Paragrafo" style="color: red; background-color: yellow; font-family: arial; font-size: medium; font-weight: normal; text-align: left; text-decoration: underline;"></p> <br> Escolha um estilo: <select id="Selecao" onchange="Atribuir (Paragrafo)"> <option value="0">color: red; background-color: yellow; font-family: arial; font-size: medium; font-weight: normal; text-align: left; text-decoration: underline;</option> <option value="1">color: blue; background-color: gray; font-family: comic sans ms; font-size: large; font-weight: bold; text-align: center; text-decoration: none;</option> <option value="1">color: yellow; background-color: black; font-family: courier new; font-size: small; font-weight: lighter; text-align: right; text-decoration: none;</option> </select> </body> </html> | |||
|
| |||
|
<html> <head> <link id="Estilo" rel="stylesheet" type="text/css" href="estilo_exemplo_estilo1.css"> <script type="text/javascript">
function Atribuir (Opcao)
</script>{ Estilo.href= Opcao.value; } </head> <body> <p id="Paragrafo" class="Paragrafo">Digite qualquer m*:</p> <input id="Campo" class="Campo" type="text" value="LMNOP"><br><br><br><br> Escolha um estilo:<br> <input class="Opcao1" id="Opcao1" name="Grupo" type="radio" value="estilo_exemplo_estilo1.css" onclick="Atribuir (Opcao1)" checked="checked">Estilo 1 <br> <input class="Opcao2" id="Opcao2" name="Grupo" type="radio" value="estilo_exemplo_estilo2.css" onclick="Atribuir (Opcao2)">Estilo 2 </body> </html> | |||
|
