简体   繁体   中英

How do change the contents of a webpage by using JavaScript?

I want to change a (Classic-ASP) webpage by using JavaScript. Sorry I must...

The page is as like this:

<input maxlength='30' id='InputX1' type='text' ...>&nbsp;

<table class='CustomSelectTable' id='CustomTableY' ...>
    <tr>
        <td style='height: 20px;'>
            <input type='text' class='clsComboboxWithBorder required' id='InputX2' ...>
        </td>
    </tr>
</table>

Really they are two variables like this:

sInputVal = "<input maxlength..."
sTalbeVal = "<table class..."

and I want to change it like this:

<table class='CustomSelectTable' id='CustomTableY' ...>
    <tr>
        <td style='height: 20px;'>
            <input maxlength='30' id='InputX1' type='text' ...>&nbsp;
            <input type='text' class='clsComboboxWithBorder required' id='InputX2' ...>
        </td>
    </tr>
</table>

Which code do you need and do you do that?

使用jQuery,它将是:

$('#InputX2').parent().prepend($('#InputX1'));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM