I want to write a function that uses the jquery function text() to replace html inside a string
tried this:
function formatData(inputstring) {
// strip HTML
var output = $(inputstring).text();
// ... do some more stuff with output
return output ;
}
and then use it like
alert (formatData("some <b>html</b> stuff"))
Why does this not work?