Get The Data-Ca-Target-Id Value For All Pages

how can I get the number to open data-ca-target-id="login_block1434" login modal on all pages

You can use the following selector

$("a[data-ca-target-id^='login_block']")

title="{__("vendor_communication.contact_vendor")}" {if $settings.Security.secure_storefront != "partial"} class="cm-dialog-opener cm-dialog-auto-size ty-vendor-communication__post-write"{else}class="ty-vendor-communication__post-write"{/if} data-ca-target-id="login_block5669" rel="nofollow">

bunu buraya nasıl yazabilirim. teşekkürler

I'm correcting my question.
This is exactly what I want to do
According to many pages, the number data-ca-target-id="login_block1434" --> 1434 is changing. cscart_bm_snapping from the database blocks/wrappers/onclick_dropdown in the wrapper column in the table.according to the data that says tpl, it gets snapping_id. We connect to cscart_bm_snapping in the database on all pages of snapping_id and add blocks/wrappers/onclick_dropdown in the wrapper column.we can show the snapping_id that says tpl. @eComLabs thanks

don't have nobody to help me

Please clarify your goal in more details. What do you want to do?

https://ibb.co/4Zct4x4print screen

i think this screenshot might help with what I mean.
I just want to dynamically get the digit after login_block here in data-ca-target-id=login_block156.

How and where do you plan to get it? By javascript after the page is loaded?

How and where do you plan to get it? By javascript after the page is loaded?

yes, it can be, or it can be with a simpler smarty, if you have a method, I can try

For js use solution from post #2. You can get list of all divs which ID starts with "login_block"

when we wrote this to the tpl file like this, it didn't work. Would you please give us some information on how to write

Try something like


then check console in the developer console of your browser

(!) Not tested

https://ibb.co/SnDFG37

gave an undefined error

According to many pages, the number data-ca-target-id="login_block1434" --> 1434 is changing. cscart_bm_snapping from the database blocks/wrappers/onclick_dropdown in the wrapper column in the table.according to the data that says tpl

https://ibb.co/SnDFG37

gave an undefined error

This is not error. Looks like the element does not have ID attribute