I have a text box. When I write first text , then java script function will fire to check whether it is a number.
For IE , the following code is returning -1 value, But Other browsers it does not alert any value. Please help me
var selected = document.selection.createRange();
var decInSel = selected.text.indexOf('.');
hasNegInSel = selected.text.indexOf('-') != -1;
alert(decInSel);