1

I have one custom tag. I want to set value to that custom tag using jquery. Though it look a silly question i spent more time in searching result for that.

My tag is

<error:description code="12345" type="error" result="description" />${description}

Now i want the get that tag and have to pass the values using jquery.

Please help me how to do this.

I have no things i tried area because i not even know how to start.

Thanks in advance

Liam
  • 27,717
  • 28
  • 128
  • 190
Monicka Akilan
  • 1,501
  • 5
  • 19
  • 42

2 Answers2

7

You need to escape the colon using two back-slashes, so just do

$('error\\:description').attr("result"); //to get result attribute
$('error\\:description').text(); //to get the related text
Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
3

I think this should do it:

jQuery("error\\:description").text("your text");
PKeidel
  • 2,559
  • 1
  • 21
  • 29
  • I tryed it and it works quite fine for me. `jQuery("error\\:description")` finds the `` element. – PKeidel Dec 09 '13 at 11:54