Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8852965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:31:56+00:00 2026-06-14T13:31:56+00:00

I have the following JavaScript code: <script type=text/javascript><!– ​$(function () { $(‘#add’).click(function() { $(this).before($(‘select:eq(0)’).clone());

  • 0

I have the following JavaScript code:

    <script type="text/javascript"><!--
​$(function () {
    $('#add').click(function() {
        $(this).before($('select:eq(0)').clone());
      if ($('select').length > 5) $(this).hide();        
    });
});​
//-->
</script>

Here is the HTML code:

<select name="dropdown">
    <option value="a">Apple</option>
    <option value="b">Bee</option>
    <option value="c">Cat</option>
    <option value="d">Donkey</option>
    <option value="e">Elephant</option>
</select>
<a href="#" id="add">Add</a>

In the jsfiddle demo its working fine, but its not working on my gsp. Any idea or I am missing out something? Whenever I click on the “Add” it just display /# on my url.

The error message I managed to figure out through inspecting the element is as follows:
Uncaught SyntaxError: Unexpected token ILLEGAL

Error Message
Screenshot
Console error screenshot from Chrome

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:31:57+00:00Added an answer on June 14, 2026 at 1:31 pm

    There are probably some illegal characters in the <script> block.

    Did you copy/paste it from somewhere else? I would suggest you put cursor at the start and end of each line and delete all characters till you are sure there are no non-visible characters.

    Alternatively delete the whole script block and retype it manually

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have the following JavaScript code: <script type=text/javascript> function clearRadioButtons() { document.getElementById(radiobutton1).checked=; //etc
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following code <div class=framepage> <header> <script type=text/javascript> function getBaseUrl() { return
I have the following code that works: <script type=text/javascript> $(document).ready(function() { // Initialise the
I have the following code that works: <script type=text/javascript> $(document).ready(function() { // Initialise the
I have the following chunk of code. It works perfectly. <div id=restaurant_locations></div> <script type=text/javascript>
Following javascript code: <script type=text/javascript charset=utf-8> function goForLogin() { var xmlhttp; xmlhttp=new XMLHttpRequest(); xmlhttp.open(POST,/account/login,true);
I have the following Javascript code add_num = { f: function(html, num) { alert(this.page);
I have the following jQuery script running on my page: <script type=text/javascript charset=utf-8 src={{
I'm using jQuery Raty and I have the following script: <script type=text/javascript charset=utf-8 src={{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.