Is it possible to select only part of a string using jquery? For example I have a text
Metuentes igitur idem latrones Lycaoniam magna parte campestrem&l
Search for the text and replace the text.
HTML :
Metuentes igitur idem latrones Lycaoniam magna parte campestrem
jQuery :
$("#findButton").click(function(){
var inputText = $("#inputTextBox").val();
var mainText = $("#mainText").text();
var updatedText = "" + inputText + "";
mainText = mainText.replace(inputText, updatedText);
$("#mainText").html(mainText);
});
Demo