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
  • 27,090
  • 8
  • 61
  • 90
0

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

try this..

$("#abc\\.xyz").val();
bipen
  • 36,319
  • 9
  • 49
  • 62