hi i am developing ajax search result.I want to highlight the words and alphabets which user inputs.I use jason api for result.I use regexp but it does not work. Code is:
var string = data;//search result
var string2 = keyword;//user input
var regex = new RegExp( string2, 'g' );
var pattern=string.match(regex);
for example If user type s in input box then all S should be bold in search result.Spain,Sweden like this or much alphabets and words as user inputs