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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:00:36+00:00 2026-05-23T09:00:36+00:00

The following A HREF element modified through the jquery deletes the nested IMG element

  • 0

The following A HREF element modified through the jquery deletes the nested IMG element .

<table id="newHead" width="90%" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" style="display: none;border: 1px #000066 groove;">
    <tr height="25px"> 
        <td style="text-align: center;padding-left: 10px;"><strong style="white-space: nowrap; font-size: 12px; ">
        <font color="#000066"> Report</font></strong></td>
        <td> <a id="url" href="mmRep.do?action=getXLSummReport&reportId="><img align="right" hspace="850px" src="images/graph_bar/graph_Excel.jpg" width="25" height="25" border="0"> </a></td>
    </tr>
</table>

This jquery removes the nested IMG element(

)

var newurl = $("a#url").attr("href") + reportId;
$("a#url").attr("href",newurl);

After i modify the href attr value, the html becomes likes this, the img element vanishes

<td> 
<a id="url" href="mmRep.do?action=getXLSummReport&reportId=75">
</a>
</td>
  • 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-23T09:00:36+00:00Added an answer on May 23, 2026 at 9:00 am

    Nope, it doesn’t.

    Make sure your reportId contains an integer, and nothing else, like quote " or a single quote '.

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

Sidebar

Related Questions

I am using the following Expression to select all hyperlinks //a[@href] How can I
I thought the following line of code should work fine: $(.1).attr('href', '#Home'); Right? But
I have the following javascript. window.location.href = _searchUrl + query.replace(/\s+/g, '+') .replace('/', '-') .replace('\\','-')
I don't know why following query doesn't work: //a/@href[@class='specified_string']
In a project i use the following code to open a window: window.open(href, 'mysite'
I have the following html: <div id=gallery> <ul> <li> <a href=url I want to
I have the following XPath: //div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href When I try out this XPath
I'm modifying the content of a href attribute with jQuery: $(a#scrolll).attr(href, # + $(li.matched).attr(id));
Suppose the following HTML: <li class=fooli> <a class=foo href=javascript:foo(this);>anchor</a> </li> <li class=fooli> <a class=foo
For the following project I will be using PHP and jQuery. I have the

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.