• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

get data-value with variable value

javascriptphp


PHP Snippet 1:

<a id="element_with_k" class="dropdown-item" data-value="<?= $k ?>"></a>

PHP Snippet 2:

const elementWithK = document.getElementById('element_with_k');

elementWithK.dataset.value // "the content of $k"

Related Snippets

Laravel print last executed SQL query with Query log

calling server using nusoap with complextype

advanced custom fields wordpress custom class

How to make Canonicals with PHP

how can I set a session variable in Drupal 8 and get it in a php script?

I want to display a sweetalert after the inserting of data in my database

PHP array stringify

How can I create a Download Page with post php method?

How to to send mail using gmail in Laravel?

WordPress - Dynamically add user ID to the end of a URL

How can I make a full text index of the column?

PHP mail function is sending blank message body

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

I can't delete my image when it is liked because of the foreign key in mysql

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

About Contact Privacy policy Terms and conditions