问题描述:

I want to replace ",," with "i,g,s".

This is my code but i cant find my fault.

And i have to do it with oblur event.

<html>

<head>

<script type="text/javascript">

function replacer()

{

var x=document.getElementById("fname");

x.value=x.value.replace("","i");

x.value=x.value.replace("","s");

x.value=x.value.replace("","g");

}

</script>

</head>

<body>

Name :<input type="text" id="fname" onblur="replacer()" />

</body>

</html>

相关阅读:
Top