jquery HTML stitching tags display and hide

Source: Internet
Author: User

About the stitching of HTML script, realize hiding and display.

I understand jquery is not very deep, if you feel that there is a problem (or unclear) place please correct.

Because the page is sometimes more complex, I get the data after the operation will need to JS processing

The HTML div table span is all stitched up.

If you want footsteps to be hidden or displayed, the Hide and show methods of the classic jquery cannot be implemented, but the debug finds

If the style changes can be displayed (or hidden), then jquery CSS can implement this feature.

Var tablestr= ' <br/><table class= "table table-striped table-bordered" style= "fontsize:12px;" align= " Center "><tbody> ' +
' <tr><td width=" 20% "> Trading time </td></tr> ' +
' <tr>< Td><span id= "Insert" style= "cursor:pointer;" onclick= "Echange (1)" > ' +detail[' inserttime '].substr (0, 19) + ' </span><span id= "target" style= "Display:none;" ><input type= "text" style= "width:70px" id= "input" ></input><input type= "button" onclick= "Echange (2 ) "value=" Modify "></input></span></td></tr> ' +
' </tbody></table> ';

function Echange (type) {
if (type==1) {
$ ("#doposconsumeinsert"). CSS ("Display", "none");
$ ("#doposconsumetarget"). CSS ("Display", "block");
}
else{
$ ("#doposconsumeinsert"). CSS ("Display", "block");
$ ("#doposconsumetarget"). CSS ("Display", "none");
}
}

The above script is only a train of thought, not necessarily 100% can execute successfully.

jquery HTML stitching tags display and hide

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.