Quote:
Originally Posted by jordandap
hey it worked but it didnt get rid of the "(Hint: S__)" is there anyway of triming this off?
|
then your example was different than the actual source. tisk tisk...
at any rate, just use a split:
Code:
//example: (modify arguments to suit your needs)
alert(
getNodes(
"data", //examine each node's .data property (only hits text nodes)
/\?/, //looking for text with a "?"
"match", //using String().match method to accept arguments[1]
document.getElementById("questiondiv") // looking in the question div
)[0].textContent.split("?")[0]+"?" //show text of first match
);