Novice Seeking Advice

Source: Internet
Author: User

I am a beginner of the Web front-end novice one. Now I'm having a problem.

<p><a href= "#" class= "Head_news_1" onclick= "return false" > big title 1</a></p><p><a href= " # "class=" Head_news_1 "onclick=" return false "> big title 2</a></p><p><a href=" # "class=" Head_news_1 "Onclick=" return false "> big title 3</a></p><p><a href=" # "class=" Head_news_1 "onclick=" return False "> big title 4</a></p>

I got four URL values from the XML document, ready to be assigned to the four links above. Use $ (". Head_news_1")

Get the Object

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6B/E8/wKioL1U6BRiyAqqiAADo_IccKRM310.jpg "title=" QQ picture 20150424165232.png "alt=" Wkiol1u6briyaqqiaado_icckrm310.jpg "/>

But ready

$ (". Head_news_1") [0].attr ("href", "Http://XXXXX")

Time to find that the $ (". Head_news_1") [0] value obtained is not an object obtained directly through $ (". Class"), which is a string. The attr operation cannot be implemented. I don't know how to solve this problem. Because there are a lot of links, a configuration class is not appropriate, please also advise how can you convert this string into an object that can be manipulated using attr?

This article is from the "Echo and you take off" blog, please be sure to keep this source http://5052416.blog.51cto.com/5042416/1638087

Novice Seeking Advice

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.