View Single Post
Old 07-18-2011, 09:16 PM   PM User | #5
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,455
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by jordandap View Post
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
);
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote
Users who have thanked rnd me for this post:
jordandap (07-19-2011)