• 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

Redis Command To Sort Keys

Autoloading classes in PHPUnit using Composer and autoload.php

Laravel Collections. Is there some kind of assertStructure method?

SQL AVG() to 2 decimals

How to get total pages of PDF with FPDF?

PHP Array split string and Integers

Split comma separated value from table column into rows using mysql?

PHPExcel file download using AJAX call

Laravel csrf token mismatch for ajax POST Request

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Additional price based on cart item count in WooCommerce

Twig - How to check if variable is a number / integer

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

How do I set the maximum php memory limit

Create a zip file and download it

About Contact Privacy policy Terms and conditions