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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:06:15+00:00 2026-05-27T16:06:15+00:00

My script generates a new input field and I want to put a ‘span’

  • 0

My script generates a new input field and I want to put a ‘span’ element around it. But I can’t figure out, how to do that.

 .append($('<a>').html('+') 
            .attr('href', '#')
            .click(function(){
                ($(this)
                    .after($('<a>').text('X')
                        .attr('href', '#')
                        .click(function(){
                            $(this).parent().remove();
                            return false;   })
                    ) 
                    .after($('<input>') // NEED A SPAN AROUND THIS ELEMENT
                        .attr('type', 'text')
                        .attr("name","avz_anzahl["+avz_array+"][]")
                        .attr("size","3")
                        .attr("style","margin-left:10px; margin-top:5px;")
                        .attr("id","anzahl_feld")
                        .attr("onblur","anzahl_vali();")
                        .attr("value", "")
                    ) 

                    .after('<br/>')).append ;
                return false;   })
    )
  • 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-27T16:06:16+00:00Added an answer on May 27, 2026 at 4:06 pm

    try changing the part like

    .after($('<span>').html($('<input>')
                            .attr('type', 'text')
                            .attr("name","avz_anzahl["+avz_array+"][]")
                            .attr("size","3")
                            .attr("style","margin-left:10px; margin-top:5px;")
                            .attr("id","anzahl_feld")
                            .attr("onblur","anzahl_vali();")
                            .attr("value", "")
                        ) 
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My PHP script generates a table with rows which can optionaly be edited or
I'm new to jQuery but want to use this form validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ In
It's a new app I want to build, but I would like some ideas,
I have a script that generates DDL scripts to define materialized views for a
I have a script that generates images from text using PHP. It's working fine
I have a script that generates two lines as output each time. I'm really
I have a Ruby script that generates a UTF8 CSV file remotely in a
Heres a simple php script that generates some XML: <?php // create doctype $dom
For automated testing (using Hudson) I have a script that generates a bunch of
I have a php script (generator.php) which generates certain HTML/XML/SVG depending on various conditions.

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.