Javascript Question!
2014-10-15, 07:03 PM,
#1
Hello guys i have a question on javascript:

I have this code:

<td param="FullName">
<span class="currText">TheWomainILove</span>
</td>


Now My question is, how to edit TheWomanILove using the document.getelement method? thanks in advance
Reply
Share This Thread :

2014-10-15, 07:21 PM, (This post was last modified: 2014-10-15, 08:01 PM by Mr. Tokyo.)
#2
document.getElementsByClassName("currText")[0].innerText = "New plain text";
document.getElementsByClassName("currText")[0].innerHTML = "New <b>HTML</b> code";
Reply
2014-10-15, 07:32 PM, (This post was last modified: 2014-10-15, 07:33 PM by TheWomanILove.)
#3
(2014-10-15, 07:21 PM)ѕedoɴιc Wrote: document.getElementByClassName("currText").innerText = "New plain text";
document.getElementByClassName("currText").innerHTML = "New <b>HTML</b> code";

Well your awesome let me see if work

(2014-10-15, 07:32 PM)TheWomanILove Wrote:
(2014-10-15, 07:21 PM)ѕedoɴιc Wrote: document.getElementByClassName("currText").innerText = "New plain text";
document.getElementByClassName("currText").innerHTML = "New <b>HTML</b> code";

Well your awesome let me see if work

Well it's not work thanks anyway
Reply
2014-10-15, 07:35 PM,
#4
I think it should work.

You can open up your browser console (F12) and see what errors you get there.
Reply
2014-10-15, 07:45 PM,
#5
(2014-10-15, 07:35 PM)ѕedoɴιc Wrote: I think it should work.

You can open up your browser console (F12) and see what errors you get there.

The Whole Code Is:

<td clickable="true" tdenabled="true" param="Code">
<span class="currText">91786</span>
</td>
<td clickable="true" tdenabled="true" param="Date">
<span class="currText">November 2014</span>
</td>
<td clickable=true" param="Amount" class="Load">
<span class="currText">1 peso</span>
</td>

I want to change the 1 peso to 0 peso using document.getelementbyid
Reply
2014-10-15, 08:02 PM, (This post was last modified: 2014-10-15, 08:06 PM by Mr. Tokyo.)
#6
I think I made some typos.

Try this: document.getElementsByClassName("currText")[2].innerText = "0 peso";

It takes the 3rd element with class "currText" and sets its inner text to "0 peso".

You can't use getElementById() because the element you're targeting has no ID.
Reply
2014-10-15, 08:06 PM,
#7
(2014-10-15, 08:02 PM)ѕedoɴιc Wrote: I think I made some typos.

Try this: document.getElementsByClassName("currText")[2].innerText = "0 peso";

It takes the 3rd element with class "currText" and sets its inner text to "0 peso".

You can't use getElementById() because the element you're targeting has no ID.

Well I can't say anything but you are genius! THANK YO!
Reply
2014-10-15, 09:55 PM,
#8
Thank you @@ѕedoɴιc , for this code :)

[Image: bg.png]
Reply


Related Threads
Thread Author Replies Views Last Post
  Youtube Adwords Campaign question. marius1991 1 77 Yesterday, 01:29 AM
Last Post: Zenit
  question about GMT2 bot. yanivsaadon 1 130 2018-06-26, 06:51 PM
Last Post: CharlieHarper
  question about gmt bot yanivsaadon 0 81 2018-06-23, 04:41 PM
Last Post: yanivsaadon
  Question Abount MaxBounty Campain Canceled 5light 1 97 2018-06-01, 06:13 PM
Last Post: Algorithm
  Cpabuild question from a new user andrew johnes 3 306 2018-05-18, 04:40 AM
Last Post: andrew johnes





About Us | Contact Us | CPA Elites | Advertise | Stats

© 2013-2018 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top