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
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";
Latest Thanks - View all

TheWomanILove(2014-10-15 07:32 PM) 
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!
Latest Thanks - View all

Qmaster2014(2014-10-15 09:55 PM) Mr. Tokyo(2014-10-15 08:07 PM) 
Reply
2014-10-15, 09:55 PM,
#8
Thank you @@ѕedoɴιc , for this code :)

[Image: bg.png]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Question about Adworkmedia COBNET 1 58 1 hour ago
Last Post: ougasoft
  Question about CPA & CPI 5light 4 179 Yesterday, 05:51 PM
Last Post: 5light
  landing page/prelander question Hypebeast 3 170 2017-10-12, 11:17 AM
Last Post: NAPK1NS
  Google Adwords & Tracking software question ArtoAllan 6 124 2017-10-11, 03:00 AM
Last Post: ArtoAllan
  Some Question About Seo 5light 2 104 2017-10-07, 12:22 AM
Last Post: mentorcell




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

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