El código es muy simple, no hablaré muchas tonterías aquí. Amigos, lea el código fuente directamente.
La copia del código es la siguiente:
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<Evista>
<meta http-oquiv = "content-type" content = "text/html; charset = gb2312">
<title> Cambio dinámico del texto y dirección de hipervínculo </title>
<link href = "css/css.css" rel = "stylesheet" type = "text/css">
<script type = "text/javaScript" lenguaje = "javaScript">
función netBankUsername ()
{
valores = form.bankname.options [form.bankname.selectedIndex] .Value;
texts = form.bankname.options [form.bankname.selectedIndex] .Text;
Switch (Form.BankName.SelectedIndex)
{
Caso 1:
//document.linksighfont>.href="http://www.cmbchina.com/ ";
//shownetbank1.innerhtml="http://www.cmbchina.com/(china Merchants Bank) ";
document.links [0] .href = valores;
ShowsTBank1.innerhtml = valores+"("+textos+")";
romper;
Caso 2:
//document.linksighfont>.href="http://www.cib.com.cn/netbank/netbank.portal ";
//shownetbank1.innerhtml="http://www.cib.com.cn/netbank/netbank.portal(industrial Bank) ";
document.links [0] .href = valores;
ShowsTBank1.innerhtml = valores+"("+textos+")";
romper;
por defecto:
alerta (form.bankname.selectedIndex);
romper;
}
}
</script>
</ablo>
<Body>
<form de acción = "cardinfo_action.asp? Action = insert" método = "post" name = "form" id = "form">
<Table>
<tr>
<TD> Seleccione </td>
<TD>
<select name = "BankName" onChange = "netBankUsername ()" id = "BankName">
<opción valor = ""> Seleccione </opción>
<opción valor = "http://www.cmbchina.com/"> China Merchants Bank </opción>
<opción valor = "http://www.cib.com.cn/netbank/netbank.portal"> Industry Bank </opción>
<opción valor = "http://www.baidu.com"> Otro </opción>
</elect> </td>
</table>
</form>
<div style = "border: 1px solid #ccc; margen: 1px; ancho: 600px; altura: 20px;"> <a href = " #" target = "_ blank" id = "showsetBank1" name = "ShowsetBank1"> sin banco seleccionado </a> </tiv>
</body>
</html>
¿No es súper simple y práctico? . . Si a menudo mira sitios más grandes, aún puede obtener muchas cosas buenas.