The escaping set is the important object studied in dynamics of transcendental entire functions. As exponential function is the most typical transcendental entire function, its escaping set has been deeply studied. It is well known that if the function is slightly disturbed, the properties of its dynamical system may vary greatly. We can't easily study different functions in the same way. Contrasting exponential function, we pay our main attention to the cosine function in this paper. We construct some escaping subsets of cosine function by Devaney-Krych codes so that the Hausdorff dimension of the subsets is equal to the given number in the interval (1, 2).