[Solved] Removing a class from value in an tag


Basic idea

//using string instead of reading value of the input aka var str = $(".foo").val();
var str = "2 + 5 = <span class="emphasis">7</span>";
//convert the string to html
var temp = $("<div>").html(str);
//find the span and unwrap it
temp.find(".emphasis").contents().unwrap();
//get the html string without the span
var updated = temp.html();
//display it
console.log(updated);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

other option is to just read .text() instead of .html() and it will strip all html.

solved Removing a class from value in an tag