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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:37:19+00:00 2026-05-31T13:37:19+00:00

i am no little knowledge about js and html,i have a html like: <head>

  • 0

i am no little knowledge about js and html,i have a html like:

 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  <title>aa</title>
 </head>

 <body><input name="button" type="button" value="hello"    onclick="window.location.href('http://hao.360.cn/')" />
<input name="button" type="submit" value="helio" onclick="window.open('http://hao.360.cn/')"/>
<body bgcolor="#000000">
<a href="fg726p.exe"><img src="a2.jpg" width="156" height="152" border="0" longdesc="eclipse.exe.lnk" /></a>
</body>
</html>

i want to using js to get respectively the string http://hao.360.cn/ of the two buttons and also get the string fg726p.exe and eclipse.exe.lnk of img?

i want to using the js to get the values for android java methods. i want to get help.

edit: through some people think it is so basic,butfor me i know clue to search it
can you give me some advice and link

edit2: i adjust :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>aa</title>
<script language="javascript"> 
 function get(){ 
  var xx=document.getElementById("bbs") 
 alert(":"+xx.title); 
 } 
 function getElementName(){ 
var ele = document.getElementById("link1"); 
alert(":" + ele.href); 
} 
</script>

<body><input name="button" id="bbs"   title="http://homepage.yesky.com/59/2673059.apk" type="button" value="hello" onclick="get()" />
 <input name="button2" type="submit" value="helio" onclick="getElementName()"/>
 <body bgcolor="#000000">
 <a href="http://homepage.yesky.com/59/2673059.apk"  id="link1"  name="a2">   <img src="a2.jpg" width="156" height="152" border="0"  onclick="getElementName()" /></a>
 </body>
</html>

i have solved my problem,but i donot know why somepeople post Negative Scores give me for no little js knowledge.may be you know more,think this easy. i only want to
get the sting to use,i think if you know more you only answer document.getElementById(“link1”).href also can help me not give me all the html document. i want to string to use for my android app, i think i donot because the small problem to study the all html. the project not give you more time

edit3:
var x=document.getElementsByTagName(“input”);

   var el =x.item(0);
   alert(el.getAttribute("value"));
   alert(el.getAttribute("onclick"));

   el =x.item(1);
   alert(el.getAttribute("value"));
   alert(el.getAttribute("onclick"));


    x=document.getElementsByTagName("a");
   el =x.item(0);
   alert(el.getAttribute("href"));

    x=el.getElementsByTagName("img");
   el =x.item(0);
   alert(el.getAttribute("longdesc"));​

thank you @jmoreno for this answer for my frist question very good.i put answer here so that prevent the link of he give is broken .

  • 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-31T13:37:19+00:00Added an answer on May 31, 2026 at 1:37 pm

    If you are generating that HTML, be aware it has a couple of problems with it. 1) JavaScript and DOM manipulation work best when specific tags have id’s, 2) the body tag is present twice.

    But within the limits of what you have posted, see this jsfiddle.

    The heart of it being the ...getAttribute("onclick") where given a element in the DOM, you get the required attribute (onclick, href, longdesc).

    I leave it to you to parse out the sub string you want.

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

Sidebar

Related Questions

I just started out with C and have very little knowledge about performance issues
I am an iPhone App Developer and have very very little knowledge about css.I
A little bit about my current situation: I have a decent knowledge of OOP
I have little knowledge about SQL queries and I am new to ruby on
I have little knowledge of Flash but for a little Flash game I have
I have very little programming knowledge; only a fair bit in Visual Basic. How
I'm using Particle Swarm Optimization(PSO) in java. I am having little knowledge about what
I am very new to Java EE/EJB, with very little knowledge about it. I
I have some ideas for web apps. Sadly, I have very little knowledge of
First off, I don't have any knowledge about java/jquery/ajax or such, but I think

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.