• 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

No definition found for function in vendor vscode

Select option menu read from database and use it's values

How to loop a tree array with unknown depth and get array blocks?

Custom post type single page not working

Last order would be re-order in wooCommerce. How is it possible?

How to properly start Laravel 8 with Bootstrap & authentication

jQuery Ajax Post with data

Wordpress add responsive srcset header image to theme

Composer Warning: openssl extension is missing. How to enable in WAMP

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

Laravel csrf token mismatch for ajax POST Request

unable to load your default controller on Codeigniter

Image upload not working through ajax Laravel

Call authenticate manually in router middleware

Upload a file Using PHP and JavaScript

About Contact Privacy policy Terms and conditions