Sunday 29 July 2012

Change the Name Survey in "Respond to this Survey"

We can change the Name Survey in "Respond to this Survey", "Survey Name" "Survey Description" to some other name using javascript.

In the following example I'll change the name to the Quiz

Following is the script to achieve the same.

<script type="text/javascript">
$(document).ready(function() {
$('[title]').removeAttr('title');
changespantext();
changeName();
});
function changespantext()
{
  var spans = document.getElementsByTagName("span");
    for(var i=0;i<spans.length; i++)
   {
    if(spans[i].innerHTML == "Respond to this Survey")
     {  //is this the "Respond to this Survey" span?
        spans[i].innerHTML = "Respond to this Quiz";  

        //change to new value
         break; 

       //hop out of the loop, we're done
     }
   }
}
function changeName()
{

   var tdid= document.getElementById("overview01");
   var tdid1= document.getElementById("overview02");

   tdid.innerHTML="Quiz Name:";
   tdid1.innerHTML="Quiz Description:";
}
 </script>




No comments:

Post a Comment