0

I want to print the text box value which id having dot(.)s.

Ex:

<input type="text" id="abc.xyz" value="Hiii"/>

How to print this value using jquery.

Niranjan Reddy
  • 23
  • 3
  • 12

2 Answers2

1

You need to Escape the dot.

$('#abc\\.xyz').val();

See Here

You can also do this using below,

$("input[id='abc.xyz']")
Community
  • 1
  • 1
Dipesh Parmar
  • 26,601
  • 7
  • 57
  • 86
0

use \\ to escape . operator since it is a class selector in jquery,

try this..

$("#abc\\.xyz").val();
bipen
  • 35,563
  • 9
  • 45
  • 62