last day (15 days later) » 

08:52
0
A: how to put the item id on console.log using add to cart button using javascript?

Ankit TiwariThere was a typo inside your JavaScript you were listening event on butns array not on each element of that array so I changed it to btn.addEventListener and it should be let action=this.dataset.action instead of let action=this.dataser.action Here is working example let butns=document.getE...

unfortunately its still not outputting the detailid.
You can see my working example it's outputing detailid. Can you update your question by making an edit based on current code changes
i have made the edits based on your code.
Hello @muneermohd9690 what you get inside your console did you receved any errors ?
no error.thats the problem.atleast if i am able to see something i can google on that. but here theres nothing.
08:52
I think your javascript is not rendered correctly inspect your HTML code in browser and check if there is javascript which you've written
i did that i wrote a cosole.log to display hello mesage in the same script and it display it properly.but when it comes to this add to cart script the it doesn't work.do you want to get a session using anydesk or something?
Yes, let's connect on anydesk give me your id
428769071
I'm not able to type
Hii
You've not provided same code as you have and I don't know why I'm not not able to type
becouse in order to help you I've to debug your code
try to connect again
maybe the keyboard was disabled
08:59
Okk
also i was trying a different code while replying to you on stackoverflow
use the anydesk chat to communicate
Okk
I've disconnected
what is the issue?
I'm trying to drbug I don't get it why it's not working
And still I'm not able to type
i am using bootstrap
does it make any difference?
09:05
@muneermohd9690 No
is there any option to take full control of my pc?
maybe request for a full control
You've to give me full control I can't request for it
i already gave you.
try again
Tyr to hard rfresh your browser
ctrl+shift+r
even tried that
09:25
Did you used any preventDefault on buttons ?
no
nothing
Okay
Hey it's hard to say but I think your button is not clickable
or your loop is not woking
no idea man
I'll connect with you afterword I've small work
button i have tried something before and it shows button clicked
09:33
If you din't find solution I'll try to help you out as soon as possible
i tried something like this
<button onclick="log()" data-detail="{{detail.id}}" data-action="add" class="btn btn-outline-secondary addtocart">Add to Cart</button>
function log(){
console.log('clicked');
}
Did it logged clicked ?
thanks.i wil keep trying.actually iahve ben on it for one week now
yes it logged clicked
Okk then check I'll add one more approch in my answer let me know it it works ?
ok. thanks for the support
what do you do?
r u working or studying?
09:35
Both

last day (15 days later) »