
Untitled
By: a guest on
Aug 11th, 2012 | syntax:
None | size: 0.51 KB | hits: 9 | expires: Never
How to use javascript to get html special characters in text input
<script type="text/javascript">
function qpush(a) {
document.getElementById('input').value += a;
}
function show(a) {
alert(document.getElementById('input').value);
}
</script>
<input type="text" id="input" />
<input type="button" onclick="qpush('π');" value="π" />
<input type="button" onclick="show()" value="go" />
<button type="button" value="π">π</button>
document.getElementById('input').value.replace(/π/g,"π");