• 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

Remove categories with all childs derived from parent category

Store / Website Column in Magento 2 Admin Grid - Custom Module

Laravel PackageManifest.php: Undefined index: name

How to properly start Laravel 8 with Bootstrap & authentication

How to find phpcs current default standard

html-php form submission after validation through JavaScript [closed]

Prestashop cUrl Login

Send same name multiple checkbox values via ajax

Unit (real unit test) of test laravel relationship

Laravel websockets AWS EC2 - Connection failed

Merge key and value of array index [duplicate]

file_put_content...fail to open stream:Permission denied in Laravel 5

How to submit the custom form data in database in WordPress without plugin using ajax?

Wordpress add responsive srcset header image to theme

PHP's array_map including keys

About Contact Privacy policy Terms and conditions