Click here to Skip to main content
15,901,001 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

my div content as below.

LEFT KNEE DEGENERATIVE DISEASE AND MEDIAL MENISioiCUS TEAR.


i want to change the div content as below


LEFT KNEE DEGENERATIVE DISE{#REV#}{#REM#}A{#REM#}{#REV#}SE AND MEDIAL MENIS{#REV#}{#INS#}ioi{#INS#}{#REV#}CUS TEAR.


how can i do this using javascript?..gttg no idea...


Thanks..
Posted
Comments
What have you tried?
enhzflep 11-Oct-13 13:40pm    
Your intention is a little unclear. Your question title seems to be at odds with the question description.

In short, do you wish to convert "DISE{#REV#}{#REM#}A{#REM#}{#REV#}" ---> DISEASE

or do you wish to convert DISEASE ---> "DISE{#REV#}{#REM#}A{#REM#}{#REV#}"?

Try this,
$('#myDiv').html().replace(/(<([^>]+)>)/ig,"");
 
Share this answer
 
v3
Comments
hasbina 11-Oct-13 9:26am    
sir
i want to delete only html tag. using your answer removg all content from div.
Thanks..
[no name] 11-Oct-13 11:16am    
I have changed the code in solution hope this will work for you.
hasbina 12-Oct-13 3:43am    
@ehsan

thank you sir..thanks a lots...
[no name] 12-Oct-13 3:48am    
If you find your solution then give a smile and press vote button too.
give your
an id value.

Use javascript DOM access documentgetElementById() with the id of your

Depending upon what you actually wish to do, change the value using .innerHTML or .innerText

(your value appears to be just text).


 
Share this answer
 
JavaScript
$("#yourDiv").html('');
 
Share this answer
 
Comments
hasbina 11-Oct-13 9:27am    
sir
i want to delete only html tag. using your answer removg all content from div.
Thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900