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