How to get the contents within the span tag

I have written a javascript function in the page.In the view one of my column contains the html coding .I am calling th e function in the Viewtemplate of this view .My problem is to get the content which within the

sample text

How to get the content which is within the div tag i.e sample text

i have used

var a=document.getElementbyId(unid) in the javascript function

but i am not getting

How to solve this problem?

thanks in advance

Subject: RE: how to get the contents within the span tag

Chances are the UNID is not a valid identifier since it perhaps starts with a digit.

Subject: RE: how to get the contents within the span tag

Thanks for your suggetion. I have tried by concatenating the document id with the string in the view (+@text(@documentuniqueid)>

and in my javascript function i have used

var a=document.getElementsById(‘S_’+unid) The problem still continues when i put alert(a) i am getting an null in the alert message.Any idea ?

Thanks in advance

Subject: RE: how to get the contents within the span tag

I think you need to show your actual code. Obviously your view formula is not +@text(@documentuniqueid)> because that’s not syntactically valid.

Did you use View Source from the browser to make sure that the HTML code in your page looks like what you expected? Often, what you think you’re getting from a formula and what actually ends up in the HTML, can be very different. Quotes are especially tricky to get right.

Why do you use “Test” as part of the name in the column formula, and “S_” in the JavaScript code?