jquery-Dynamic Set UL li a link target

Source: Internet
Author: User

Overview:

First on my layout chart:

UL in each Li bread with a ' a ' hyperlink, can guess, I want to not click Ul->li inside each A, link to a different page, here, I use the IFRAME to complete.

The main HTML code is:

1 <Divclass= "Warp">2     <Divclass= "title">3         <ulID= "Fengcai_title">4             <Li><ahref="#">Teacher's Demeanor 1</a></Li>5             <Li><ahref="#">Teacher's Demeanor 2</a></Li>6             <Li><ahref="#">Teacher's Demeanor 3</a></Li>7         </ul>8     </Div>9     <Divclass= "Content">Ten         <iframescrolling= "Auto"Target= "_parent"ID= "Content_frame"src= "content/tar.html"> </iframe> One </Div>

Then download the relevant jquery library, complete with the jquery code:

<script type= "Text/javascript" src= "jq/jquery-2.1.0.min.js" ></script><script type= "Text/javascript "Src=" jq/jquery-2.1.0-vsdoc.js "></script><script type=" Text/javascript "src=" Jq/jQuery2.1.js "> </script><script type= "Text/javascript" >    function  dd () {                $ ("#fengcai_title Li a "). Click (function() {            $ (this. InnerHTML +". html ");        });      </script>

Where the page file is uniformly placed in the ' content ' directory, the page's file name corresponds to the text in a. The DD () function can be called in the OnLoad event of the body.

jquery-Dynamic Set UL li a link target

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.