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

  • Home
  • SEARCH
  • 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 8598859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:15:27+00:00 2026-06-12T01:15:27+00:00

I’m just getting started in programming and somehow can’t come up with any sensible

  • 0

I’m just getting started in programming and somehow can’t come up with any sensible approach to the following problem, so any help would be greatly appreciated! I have a .html file structured like this:

<head>
<title>ABC</title>
</head>
<body>
<div class="norm">
...    
<span class="jnenbez">13</span>
....    
<div class="Absatz">text</div>
<div class="Absatz">text</div>
<div class="Absatz">CITE HERE**</div>

The “norm” div is the one parent node. The “jnenbez” span and the “Absatz” divs are inside the “norm” div, but how deeply they are nested can vary. Now I want to cite the “CITE HERE” area, meaning to generate the output of “jnenbez 13 Absatz 3 ABC” – meaning getting the text content of the “jnenbez” span of the same “norm” div, getting the index number of the “Absatz” div, since it is the third child “Absatz” of the “norm” div and getting the content.

1) How could I give this string to the user, so he could copy paste it somewhere else? It seems it is not easily possible to modify the copy+paste behavior of Firefox. An obvious solution would be to put the output in brackets like [jnenbez…] at the end of each divs text content, but that would reduce readability of the html…

2) Is it even possible to automatically generate this output via JQuery?

  • 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-12T01:15:29+00:00Added an answer on June 12, 2026 at 1:15 am

    Not sure about a good way to store/display the info.
    Also, unsure of what other mark-up you would have in the class=’norm’ container. This is vitally important and impacts entirely the shape of the useful solution.

    I’ve assumed a particular structure – one that says the first contained span is one of interest. Another assumption is that the only divs in the container are of interest and need to be counted.

    I’m sure you can break it easily enough. 😀

    <!DOCTYPE html>
    <html>
    <head>
    <script>
    function onBtnPress(element)
    {
        var result;
    
        var cont = element.parentNode;
    
        var span = cont.getElementsByTagName('span')[0];
        result = span.className + " ";
        result += span.innerHTML + " ";
    
        var divList = cont.getElementsByTagName('div');
        result += divList[0].className + " ";
        result += divList.length+" ";
        result += document.title;
    
        cont.getElementsByTagName('p')[0].innerHTML = result;
    }
    </script>
    
    <title>ABC</title>
    </head>
    <body>
        <div class="norm">
            <span class="jnenbez">13</span>
            <div class="Absatz">text</div>
            <div class="Absatz">text</div>
            <div class="Absatz">CITE HERE**</div>
            <button onclick='onBtnPress(this);'>click me</button>
            <p>[string here]</p>
        </div>
        <div class="norm">
            <span class="Crapple">8</span>
            <div class="ipod">worst</div>
            <div class="ipod">music</div>
            <div class="ipod">player</div>
            <div class="ipod">I ever</div>
            <div class="ipod">bought</div>
            <div class="ipod">CITE HERE**</div>
            <button onclick='onBtnPress(this);'>click me</button>
            <p>[string here]</p>
        </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was

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.