Created
February 18, 2020 14:00
-
-
Save AndreaBarghigiani/5e4075fedc5bd2454d13305ab26d161a to your computer and use it in GitHub Desktop.
WordPress aggiungere script e calcolare totale da cella di una tabella.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_enqueue_scripts', 'sam_load_scripts'); | |
function sam_load_scripts(){ | |
wp_enqueue_script( 'slug-tuo-script', get_bloginfo( 'stylesheet_directory' ) . '/js/tuo-script.js', array( 'jquery' ), '1.0.0' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
let tot = 0; | |
$('.tua-classe td:nth-child(posizione)').each(function(){ | |
tot += $(this).html(); | |
}); | |
//Trova un elemento HTML e aggiungi il tuo totale | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment