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 3440396
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:25:36+00:00 2026-05-18T08:25:36+00:00

I need to do a function on Jquery that write in a div some

  • 0

I need to do a function on Jquery that write in a div some HTML elements.

Code is this :

function loadAppartamenti() {
    $('.profilo_2').empty();
    $('.profilo_2').html("<label class='article_span'>Inserisci Zona (es. Via/Località)</label> /
                          <input id='art_1' class='article_input' /> /
                          <label class='article_span'>Costo (€ Mese)</label> /
                          <input id='art_2' class='article_input' /> /
                          <label class='article_span'>Disponibilità (Periodo In Mesi)</label> /
                          <input id='art_3' class='article_input' /> /
                          <label class='article_span'>Condizioni</label> /
                          <input id='art_4' class='article_input' /> /
                          <label class='article_span'>Servizi Presenti</label> /
                          <input id='art_5' class='article_input' />");
}

I need to clean the code as clean as possible, so i’ve aligned it (I go to the new line when i write a line).

I know that on Javascript i can do it, adding a / at the end of each line. But maybe i wrong remember. In fact if i run this code on Chrome, the console says “Uncaught SyntaxError: Unexpected token ILLEGAL”.

How can I fix this problem? I don’t want to write the code on 1 line 🙂

  • 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-05-18T08:25:37+00:00Added an answer on May 18, 2026 at 8:25 am

    You need a backslash at the end of each line rather than a forward slash:

    var s = "one\
             two\
             three";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a small function for jQuery that would close multiple DIV elements, but
I need to write, in JavaScript (I am using jQuery), a function that is
I need to put a one second delay in this jQuery function so that
I am attempting to write some jQuery code that will expand a paragraph when
I need a way to use the jquery .live() function to act on elements
I have the following jQuery which I need adapting: $(document).ready(function(){ $(.rss-popup a).hover(function() { $(this).next(em).stop(true,
I desperately need some help on this one. I've created a <script> that closely
Hello I have a jQuery function that will send to a php file some
I'm new to jQuery and need some help to show and hide a div
hi guys i need some help here^^ i got a tag <html> <head> function

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.