Just tested the below code on a SCORM site. Works. It is a bit different than above.
To reverse the student name code this action with the below JavaScript function.
Action: Modify Variable
Target: _studentNameValue: Javascript: reverseName()
Condition: AICC_Student_Name Is Not Empty
And in an HTML object enter this JavaScript: