How to get SurveyID from javascript


Does anyone know how to get to the survey id (“2323232” in this example) dynamically from javascript?



I could grab a bunch of DOM elements and regex to find the ID, but it seems there should be a cleaner way.

Rob Arnold answered

    Much obliged!

    Rob Arnold answered

      Hi Rob!

      I know this is a little late but I grab the survey ID from the div on the page with the class “sg-hidden-inputs” (it’s right under the form element). One of those hidden inputs has the survey id, and you can grab it like this:



      Hope that helps!

      Marybeth answered


        Question stats

        • Active
        • Views4989 times
        • Answers2 answers
        • Followers1 follower