greddin
asked on
Help with Javascript innerHtml please
I have a Javascript that is looping through a table's rows. One of table cells (TD) contains a date. Here's a sample:
I have a variable named "col_date" which needs contain just the date (10/30/2015).
Right now col_date contains the whole
Thanks
<td class="ms-cellstyle ms-vb2"><span class="ms-noWrap" title="10/30/2015">10/30/2015</span></td>
I have a variable named "col_date" which needs contain just the date (10/30/2015).
var col_date = row.cells[suspense_date_column].innerHTML;
Right now col_date contains the whole
<span class="ms-noWrap" title="10/30/2015">10/30/2015</span>
. How can I return just the date without the span tag?Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, both solutions are perfect. Appreciate the help!
Question: the HTML of the cell looks like a SharePoint generated table (at least the class names do :-))
Why dont you use jQuery?
Alternative solution:
Open in new window
HTH
Rainer