• 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

zsh: command not found: php

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

php mysql + create a friend request system

OctoberCMS / Anonymous Global Scope

How to create a scheduler application in php

Creating a config file in PHP

Using PHP to connect to a remote MSSQL database

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

How do I Post to .txt document before form submits

How do I call Validator from a namespace with an already existing Validator class

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

ConstraintViolationListInterface to Exception in Symfony

Limit WooCommerce products in cart only from one custom taxonomy

JQuery content editable div and text box on submit not sending POST

Parameter is not sent to Laravel route in Ajax

About Contact Privacy policy Terms and conditions