简体   繁体   English

用于NOWRAP的javascript replace()方法和脚本

[英]javascript replace() Method for NOWRAP, and Script

I have a problem , this is fixed code that I can't change manually. 我有一个问题,这是固定的代码,无法手动更改。 The question is if it possible with JavaScript replace the actual text inside code?? 问题是,是否有可能用JavaScript替换代码中的实际文本?

  <td nowrap="nowrap">Код безопасности<span class="myWinError">*</span>:</td>

    <div class="myBtnCont x-unselectable" unselectable="on" id="subbutmyAdvF3" onclick="document.getElementById('submmyAdvF3').click();"><a href="javascript://" onclick="return false;">Отправить</a></div>

Any Ideas??? 有任何想法吗???

This is the actual pop up box where this elements are 这是此元素所在的实际弹出框

<div id="_uwndWnd1" class="xw-plain x-unselectable xw-resize xw-active" unselectable="on" style="position: absolute; width: 400px; z-index: 2; left: 0px; overflow: visible;"><div class="xw-disabled" style="overflow: hidden; position: absolute; z-index: 30010; width: 400px; height: 168px; display: none;" unselectable="on"></div><div class="xw-tl" unselectable="on"><div class="xw-tr" unselectable="on"><div class="xw-tc" unselectable="on"><div class="xw-sps" unselectable="on"></div><div class="xw-hdr xw-draggable" unselectable="on"><div class="xt xt-close xt-close2" unselectable="on"></div><div class="xt xt-maxi" unselectable="on" style="display: none;"></div><div class="xt xt-rest" unselectable="on" style="display: none;"></div><div class="xt xt-mini" unselectable="on" style="display: none;"></div><span class="xw-hdr-text" unselectable="on" title="">Užsakyti kuponas</span></div></div></div></div><div class="xw-ml" unselectable="on"><div class="xw-mr" unselectable="on"><div class="xw-mc" unselectable="on"><div class="xw-body" unselectable="on"><div style="overflow: hidden; height: 127px;" unselectable="on"><div class="myWinCont" style="display: none; overflow: hidden;" align="left" unselectable="on"><div align="left" unselectable="on"><div class="myWinLoad" unselectable="on"></div></div></div><div class="myWinCont" style="overflow: auto; width: 378px; display: block; height: 100%;" align="left" unselectable="on">
<form id="myAdvF3" onsubmit="sendAdvice834();return false;">
<table border="0" width="98%" cellspacing="1">

<tbody><tr><td nowrap="nowrap" width="30%">Jūsų e-mail <span class="myWinError">*</span>:</td><td><input maxlength="50" size="30" style="width:100%;" id="adv3f2" name="emailt"></td></tr>
<tr><td colspan="2"><hr></td></tr>

<tr><td nowrap="nowrap">Код безопасности <span class="myWinError">*</span>:</td><td><input type="text" name="code" id="adv3code" size="5" maxlength="5" style="font-size:18px !important;padding:6px !important;width:70px !important;"><input type="hidden" name="seckey" value="3788857711912799178"> <img alt="" style="margin:0;padding:0;border:0;cursor:pointer;" id="adv3secuImg" align="absmiddle" title="Обновить код безопасности" onclick="this.src='http://groziokuponai.ucoz.com/secure/?k=3788857711912799178;s=index;tm='+Math.random();" src="http://groziokuponai.ucoz.com/secure/?k=3788857711912799178;s=index;tm=1371152102"></td></tr><tr><td colspan="2"><hr></td></tr>
<tr><td id="msgAdv38" align="right"></td><td>
<table border="0" cellpadding="0" cellspacing="0" onmousedown="this.className='downBtn'" onmouseover="this.className='overBtn'" onmouseout="this.className='outBtn'">
<tbody><tr>
<td class="myBtnLeft"><img alt="" border="0" src="http://s26.ucoz.net/img/1px.gif"></td>
<td class="myBtnCenter"><div class="myBtnCont x-unselectable" unselectable="on" id="subbutmyAdvF3" onclick="document.getElementById('submmyAdvF3').click();"><a href="javascript://" onclick="return false;">Отправить</a></div></td>
<td class="myBtnRight"><img alt="" border="0" src="http://s26.ucoz.net/img/1px.gif"></td>
<td style="visibility:hidden;"><input type="image" src="http://s26.ucoz.net/img/ma/1px.gif" style="width:1px;" onclick="if($('#subbutmyAdvF3').hasClass('myBtnDis')){return false;}$('#subbutmyAdvF3').addClass('myBtnDis');" name="submmyAdvF3" id="submmyAdvF3"></td>
</tr>
</tbody></table>
    </td></tr>
</tbody></table>
<input type="hidden" name="a" value="32"><input type="hidden" name="t" value="1"><input type="hidden" name="id" value="3"><input type="hidden" name="page" value="http://groziokuponai.ucoz.com/news/pedikiura/2013-05-31-12">
</form>
</div></div></div></div></div></div><div class="xw-bl" unselectable="on"><div class="xw-br" unselectable="on"><div class="xw-bc" unselectable="on"></div></div></div><div class="xw-blank" style="display:none" unselectable="on"></div></div>

Judging by given markup, following JS code should make the replacement: 从给定的标记来看,以下JS代码应该替代:

<script>
    document.getElementsByClassName("myWinError")[1].parentNode.innerHTML = 'Кот Шредингера <span class="myWinError">*</span>';
    document.getElementsByClassName("myBtnCont")[0].firstChild.innerHTML = 'Заправить';
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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