• 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

How to override htaccees file for cache control header

Laravel Schedule not sending email

Cannot connect to own websocket server when on secured domain

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

XDebug not working in VScode for php debugging

PHP Warning: Module already loaded in Unknown on line 0

java URL working on browser but not in client program

protect images from being copied

Cannot pass null argument when using type hinting

How to convert binary string to normal string in php

Send Outlook 2010 email using PHP

Best way to scrolldown onpageload

Display the WooCommerce product price inside a custom function

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

About Contact Privacy policy Terms and conditions