Skip to content

Instantly share code, notes, and snippets.

@Ataurr
Last active October 22, 2018 11:43
Show Gist options
  • Save Ataurr/7de5df53275f894a32c7bf08b3694cd5 to your computer and use it in GitHub Desktop.
Save Ataurr/7de5df53275f894a32c7bf08b3694cd5 to your computer and use it in GitHub Desktop.
$(document).ready(function($) {
$('.mls').each(function(index, el) {
var this_val = $(this).text();
//'icon-play-button' => array('group' => 'finences-icons'),
$print_class = "'icon"+this_val+"' => array('group' => 'finences-icons'),";
console.log($print_class);
});
});
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script>
$( document ).ready( function ( $ ) {
$( '.mls' ).each( function ( index, el ) {
var this_val = $( this ).text( );
//'icon-play-button' => array('group' => 'finences-icons'),
// $print_class = "'icon"+this_val+"' => array('group' => 'finences-icons'),"; // this is for unyson
// $print_class = '{"name":"Font Awesome", "icons":["icon'+this_val+'"]}'; //Json
// $print_class = "'icon"+this_val+"' => 'icon"+this_val+"',"; elementor array
// $print_class = "'icon"+this_val+"' => 'icon"+this_val+"',";
$print_class = '{"name":"Font Awesome", "icons":["icon' + this_val + '"]}';
console.log( $print_class );
} );
} );
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment